@genesislcap/foundation-logger 14.448.0 → 14.449.1-alpha-12eee28.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.
@@ -1,4 +1,4 @@
1
- import { Consola, ConsolaOptions } from 'consola';
1
+ import { ConsolaInstance, ConsolaOptions } from 'consola/core';
2
2
  /**
3
3
  * Used to set the logging level.
4
4
  *
@@ -11,12 +11,12 @@ import { Consola, ConsolaOptions } from 'consola';
11
11
  *
12
12
  * @public
13
13
  */
14
- export { LogLevel, logType } from 'consola';
14
+ export { LogLevel, LogLevels, LogType } from 'consola/core';
15
15
  /**
16
16
  * Options for creating a logger.
17
17
  * @public
18
18
  */
19
- export interface LoggerOptions extends ConsolaOptions {
19
+ export interface LoggerOptions extends Partial<ConsolaOptions> {
20
20
  }
21
21
  /**
22
22
  * A logger that extends the `Consola` logger.
@@ -26,7 +26,7 @@ export interface LoggerOptions extends ConsolaOptions {
26
26
  *
27
27
  * @public
28
28
  */
29
- export interface Logger extends Consola {
29
+ export interface Logger extends ConsolaInstance {
30
30
  /**
31
31
  * A logger method for deprecated symbols.
32
32
  *
@@ -53,7 +53,7 @@ export interface Logger extends Consola {
53
53
  * A logger that extends the `Consola` logger.
54
54
  * @public
55
55
  */
56
- export interface Logger extends Consola {
56
+ export interface Logger extends ConsolaInstance {
57
57
  }
58
58
  /**
59
59
  * The default logger options.
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,SAAS,CAAC;AAG5D;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,OAAO;IACrC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvF;AAED;;;GAGG;AACH,MAAM,WAAW,MAAO,SAAQ,OAAO;CAAG;AAE1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAElC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAoC,GAAG,MAAM,CAmBhG"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAa,MAAM,cAAc,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,OAAO,CAAC,cAAc,CAAC;CAAG;AAEjE;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,eAAe;IAC7C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvF;AAED;;;GAGG;AACH,MAAM,WAAW,MAAO,SAAQ,eAAe;CAAG;AAElD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAElC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAoC,GAAG,MAAM,CAehG"}
@@ -1,5 +1,5 @@
1
- import { LogLevel } from 'consola';
2
- import consola from 'consola/src/browser';
1
+ import consola from 'consola';
2
+ import { LogLevels } from 'consola/core';
3
3
  /**
4
4
  * Used to set the logging level.
5
5
  *
@@ -12,13 +12,13 @@ import consola from 'consola/src/browser';
12
12
  *
13
13
  * @public
14
14
  */
15
- export { LogLevel } from 'consola';
15
+ export { LogLevels } from 'consola/core';
16
16
  /**
17
17
  * The default logger options.
18
18
  * @public
19
19
  */
20
20
  export const defaultLoggerOptions = {
21
- level: LogLevel.Debug,
21
+ level: LogLevels.debug,
22
22
  };
23
23
  /**
24
24
  * Creates a logger with the given name and options.
@@ -50,9 +50,12 @@ export const defaultLoggerOptions = {
50
50
  * @public
51
51
  */
52
52
  export function createLogger(name, options = defaultLoggerOptions) {
53
- const logger = consola.create(Object.assign(Object.assign({}, options), { defaults: Object.assign(Object.assign({}, options.defaults), { tag: name }) }));
54
- logger.deprecated = (symbol, instruction = 'Consult docs for better alternative.', removalVersionTarget) => {
55
- logger.warn(`Deprecated symbol used '${symbol}'. ${instruction}`, `${removalVersionTarget ? `Will be removed in version ${removalVersionTarget}.` : ''}`);
53
+ const logger = consola.withTag(name);
54
+ if ((options === null || options === void 0 ? void 0 : options.level) !== undefined)
55
+ logger.level = options.level;
56
+ const typedLogger = logger;
57
+ typedLogger.deprecated = (symbol, instruction = 'Consult docs for better alternative.', removalVersionTarget) => {
58
+ typedLogger.warn(`Deprecated symbol used '${symbol}'. ${instruction}`, `${removalVersionTarget ? `Will be removed in version ${removalVersionTarget}.` : ''}`);
56
59
  };
57
- return logger;
60
+ return typedLogger;
58
61
  }
@@ -270,8 +270,8 @@
270
270
  },
271
271
  {
272
272
  "kind": "Reference",
273
- "text": "Consola",
274
- "canonicalReference": "consola!Consola:class"
273
+ "text": "ConsolaInstance",
274
+ "canonicalReference": "consola!ConsolaInstance:type"
275
275
  },
276
276
  {
277
277
  "kind": "Content",
@@ -377,11 +377,24 @@
377
377
  "kind": "Content",
378
378
  "text": "export interface LoggerOptions extends "
379
379
  },
380
+ {
381
+ "kind": "Reference",
382
+ "text": "Partial",
383
+ "canonicalReference": "!Partial:type"
384
+ },
385
+ {
386
+ "kind": "Content",
387
+ "text": "<"
388
+ },
380
389
  {
381
390
  "kind": "Reference",
382
391
  "text": "ConsolaOptions",
383
392
  "canonicalReference": "consola!ConsolaOptions:interface"
384
393
  },
394
+ {
395
+ "kind": "Content",
396
+ "text": ">"
397
+ },
385
398
  {
386
399
  "kind": "Content",
387
400
  "text": " "
@@ -395,7 +408,7 @@
395
408
  "extendsTokenRanges": [
396
409
  {
397
410
  "startIndex": 1,
398
- "endIndex": 2
411
+ "endIndex": 5
399
412
  }
400
413
  ]
401
414
  }
@@ -1,7 +1,8 @@
1
- import { Consola } from 'consola';
2
- import { ConsolaOptions } from 'consola';
3
- import { LogLevel } from 'consola';
4
- import { logType } from 'consola';
1
+ import { ConsolaInstance } from 'consola/core';
2
+ import { ConsolaOptions } from 'consola/core';
3
+ import { LogLevel } from 'consola/core';
4
+ import { LogLevels } from 'consola/core';
5
+ import { LogType } from 'consola/core';
5
6
 
6
7
  /**
7
8
  * Creates a logger with the given name and options.
@@ -48,7 +49,7 @@ export declare const defaultLoggerOptions: LoggerOptions;
48
49
  *
49
50
  * @public
50
51
  */
51
- export declare interface Logger extends Consola {
52
+ export declare interface Logger extends ConsolaInstance {
52
53
  /**
53
54
  * A logger method for deprecated symbols.
54
55
  *
@@ -76,18 +77,20 @@ export declare interface Logger extends Consola {
76
77
  * A logger that extends the `Consola` logger.
77
78
  * @public
78
79
  */
79
- export declare interface Logger extends Consola {
80
+ export declare interface Logger extends ConsolaInstance {
80
81
  }
81
82
 
82
83
  /**
83
84
  * Options for creating a logger.
84
85
  * @public
85
86
  */
86
- export declare interface LoggerOptions extends ConsolaOptions {
87
+ export declare interface LoggerOptions extends Partial<ConsolaOptions> {
87
88
  }
88
89
 
89
90
  export { LogLevel }
90
91
 
91
- export { logType }
92
+ export { LogLevels }
93
+
94
+ export { LogType }
92
95
 
93
96
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-logger",
3
3
  "description": "Genesis Foundation Logger",
4
- "version": "14.448.0",
4
+ "version": "14.449.1-alpha-12eee28.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "2c815fd566cf24fe967de97e4692a0456f402afa"
36
+ "gitHead": "ec3e5e01881f0b7d4ffc913bb98eb58d2d2a9c6d"
37
37
  }