mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-06 14:16:41 +00:00
feat(pockethost): expose logSettings
This commit is contained in:
parent
589f8c00c3
commit
737b4b855a
5
.changeset/thirty-shirts-battle.md
Normal file
5
.changeset/thirty-shirts-battle.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'pockethost': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
logSettings now exported from core
|
@ -1,4 +1,3 @@
|
|||||||
import { forEach } from '@s-libs/micro-dash'
|
|
||||||
import { config } from 'dotenv'
|
import { config } from 'dotenv'
|
||||||
import envPaths from 'env-paths'
|
import envPaths from 'env-paths'
|
||||||
import { dirname, join } from 'path'
|
import { dirname, join } from 'path'
|
||||||
@ -8,6 +7,7 @@ import { mkBoolean, mkCsvString, mkNumber, mkPath, mkString } from '../core'
|
|||||||
import { InstanceId } from './common'
|
import { InstanceId } from './common'
|
||||||
import { DEBUG, IS_DEV } from './common/debug'
|
import { DEBUG, IS_DEV } from './common/debug'
|
||||||
import { Settings } from './core/Settings'
|
import { Settings } from './core/Settings'
|
||||||
|
import { logSettings } from './core/logSettings'
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
@ -58,12 +58,6 @@ export const NODE_ENV = () => process.env.NODE_ENV
|
|||||||
export const INSTANCE_DATA_DIR = (id: InstanceId, ...paths: string[]) =>
|
export const INSTANCE_DATA_DIR = (id: InstanceId, ...paths: string[]) =>
|
||||||
join(DATA_DIR(), id, ...paths)
|
join(DATA_DIR(), id, ...paths)
|
||||||
|
|
||||||
export const logConstants = () => {
|
|
||||||
forEach(settings, (v, k) => {
|
|
||||||
console.log(`${k}: ${v}`)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DEBUG()) {
|
if (DEBUG()) {
|
||||||
logConstants()
|
logSettings(settings)
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,6 @@ export * from './Settings'
|
|||||||
export * from './asyncExecutionGuard'
|
export * from './asyncExecutionGuard'
|
||||||
export * from './exit'
|
export * from './exit'
|
||||||
export * from './internal'
|
export * from './internal'
|
||||||
|
export * from './logSettings'
|
||||||
export * from './smartFetch'
|
export * from './smartFetch'
|
||||||
export * from './tryFetch'
|
export * from './tryFetch'
|
||||||
|
7
packages/pockethost/src/core/logSettings.ts
Normal file
7
packages/pockethost/src/core/logSettings.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { forEach } from '@s-libs/micro-dash'
|
||||||
|
|
||||||
|
export const logSettings = (settings: { [_: string]: any }) => {
|
||||||
|
forEach(settings, (v, k) => {
|
||||||
|
console.log(`${k}: ${v}`)
|
||||||
|
})
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user