@creejs/commons-logging 1.0.2 → 2.0.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 +3 -2
- package/types/log-config.d.ts +12 -5
- package/types/log-level.d.ts +6 -0
- package/types/provider-type.d.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creejs/commons-logging",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Common Utils About Logging",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"private": false,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"types/",
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
|
+
"types": "types/index.d.ts",
|
|
13
14
|
"publishConfig": {
|
|
14
15
|
"access": "public"
|
|
15
16
|
},
|
|
@@ -24,6 +25,6 @@
|
|
|
24
25
|
"author": "rodney.vin@gmail.com",
|
|
25
26
|
"license": "Apache-2.0",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@creejs/commons-lang": "^
|
|
28
|
+
"@creejs/commons-lang": "^2.0.0"
|
|
28
29
|
}
|
|
29
30
|
}
|
package/types/log-config.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export const type2Factory: Map<string, LogFactory>;
|
|
|
27
27
|
* @param {string} typeName - The type identifier for the provider.
|
|
28
28
|
* @param {Provider} provider - The logging provider implementation.
|
|
29
29
|
* @returns {void}
|
|
30
|
+
* @alias module:LogConfig.addProvider
|
|
30
31
|
*/
|
|
31
32
|
export function addProvider(typeName: string, provider: Provider): void;
|
|
32
33
|
/**
|
|
@@ -45,9 +46,12 @@ export function clearProviders(): void;
|
|
|
45
46
|
/**
|
|
46
47
|
* Returns an array of all registered factory types and intances.
|
|
47
48
|
* 1. Each entry is a [type, factory] pair
|
|
48
|
-
* @returns {Array<
|
|
49
|
+
* @returns {Array<{0:string, 1:Provider}>} An array of factory entries.
|
|
49
50
|
*/
|
|
50
|
-
export function listProviders(): Array<
|
|
51
|
+
export function listProviders(): Array<{
|
|
52
|
+
0: string;
|
|
53
|
+
1: Provider;
|
|
54
|
+
}>;
|
|
51
55
|
/**
|
|
52
56
|
* Registers a log factory for a given type name.
|
|
53
57
|
* @param {string} typeName - The name of the log type to register.
|
|
@@ -74,9 +78,12 @@ export function clearFactories(): void;
|
|
|
74
78
|
/**
|
|
75
79
|
* Returns an array of all registered factory types and intances.
|
|
76
80
|
* 1. Each entry is a [type, factory] pair
|
|
77
|
-
* @returns {Array<
|
|
81
|
+
* @returns {Array<{0:string, 1:LogFactory}>} An array of factory entries.
|
|
78
82
|
*/
|
|
79
|
-
export function listFactories(): Array<
|
|
83
|
+
export function listFactories(): Array<{
|
|
84
|
+
0: string;
|
|
85
|
+
1: LogFactory;
|
|
86
|
+
}>;
|
|
80
87
|
export function clear(): void;
|
|
81
88
|
import Provider = require("./provider");
|
|
82
|
-
import LogFactory = require("./log-factory");
|
|
89
|
+
import LogFactory = require("./log-factory");
|
package/types/log-level.d.ts
CHANGED
|
@@ -43,18 +43,24 @@ export const DefaultLevel: number;
|
|
|
43
43
|
* Checks if the given level is a valid log level.
|
|
44
44
|
* @param {number} level - The log level to check.
|
|
45
45
|
* @returns {boolean} True if the level is valid, false otherwise.
|
|
46
|
+
* @memberof LogLevel
|
|
47
|
+
* @static
|
|
46
48
|
*/
|
|
47
49
|
export function hasLevel(level: number): boolean;
|
|
48
50
|
/**
|
|
49
51
|
* Checks if the given level name exists in the Name enum/object.
|
|
50
52
|
* @param {string} levelName - The name of the log level to check.
|
|
51
53
|
* @returns {boolean} True if the level name exists, false otherwise.
|
|
54
|
+
* @memberof LogLevel
|
|
55
|
+
* @static
|
|
52
56
|
*/
|
|
53
57
|
export function hasName(levelName: string): boolean;
|
|
54
58
|
/**
|
|
55
59
|
* Validates that a given level is a number and falls within the valid range.
|
|
56
60
|
* @param {*} level - The log level to validate
|
|
57
61
|
* @throws {Error} If level is not a number or outside valid range (Level.OFF to Level.ALL)
|
|
62
|
+
* @memberof LogLevel
|
|
63
|
+
* @static
|
|
58
64
|
*/
|
|
59
65
|
export function assertLevel(level: any): void;
|
|
60
66
|
/**
|
package/types/provider-type.d.ts
CHANGED