hazo_config 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/config-loader.ts +3 -2
- package/src/lib/types.ts +1 -0
package/package.json
CHANGED
package/src/lib/config-loader.ts
CHANGED
|
@@ -16,7 +16,8 @@ import { ConfigErrorCode as EC } from './types'
|
|
|
16
16
|
/**
|
|
17
17
|
* No-op logger implementation (default when no logger provided)
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
19
|
+
const no_op_logger: Logger = {
|
|
20
|
+
debug: () => {},
|
|
20
21
|
info: () => {},
|
|
21
22
|
warn: () => {},
|
|
22
23
|
error: () => {}
|
|
@@ -41,7 +42,7 @@ export class HazoConfig implements ConfigProvider {
|
|
|
41
42
|
*/
|
|
42
43
|
constructor(options: HazoConfigOptions) {
|
|
43
44
|
this.filePath = path.resolve(options.filePath)
|
|
44
|
-
this.logger = options.logger ||
|
|
45
|
+
this.logger = options.logger || no_op_logger
|
|
45
46
|
|
|
46
47
|
// Validate file exists
|
|
47
48
|
if (!fs.existsSync(this.filePath)) {
|
package/src/lib/types.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Matches the Logger interface from hazo_connect for consistency
|
|
13
13
|
*/
|
|
14
14
|
export interface Logger {
|
|
15
|
+
debug(message: string, data?: any): void
|
|
15
16
|
info(message: string, data?: any): void
|
|
16
17
|
warn(message: string, data?: any): void
|
|
17
18
|
error(message: string, data?: any): void
|