@firebase/logger 0.4.3 → 0.4.4
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/dist/esm/index.d.ts +17 -17
- package/dist/esm/index.esm2017.js +215 -215
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/logger.d.ts +96 -96
- package/dist/esm/test/custom-logger.test.d.ts +17 -17
- package/dist/esm/test/logger.test.d.ts +17 -17
- package/dist/index.cjs.js +215 -215
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/src/logger.d.ts +96 -96
- package/dist/test/custom-logger.test.d.ts +17 -17
- package/dist/test/logger.test.d.ts +17 -17
- package/package.json +2 -2
package/dist/esm/src/logger.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
18
|
-
export interface LogOptions {
|
|
19
|
-
level: LogLevelString;
|
|
20
|
-
}
|
|
21
|
-
export
|
|
22
|
-
export interface LogCallbackParams {
|
|
23
|
-
level: LogLevelString;
|
|
24
|
-
message: string;
|
|
25
|
-
args: unknown[];
|
|
26
|
-
type: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A container for all of the Logger instances
|
|
30
|
-
*/
|
|
31
|
-
export declare const instances: Logger[];
|
|
32
|
-
/**
|
|
33
|
-
* The JS SDK supports 5 log levels and also allows a user the ability to
|
|
34
|
-
* silence the logs altogether.
|
|
35
|
-
*
|
|
36
|
-
* The order is a follows:
|
|
37
|
-
* DEBUG < VERBOSE < INFO < WARN < ERROR
|
|
38
|
-
*
|
|
39
|
-
* All of the log types above the current log level will be captured (i.e. if
|
|
40
|
-
* you set the log level to `INFO`, errors will still be logged, but `DEBUG` and
|
|
41
|
-
* `VERBOSE` logs will not)
|
|
42
|
-
*/
|
|
43
|
-
export declare enum LogLevel {
|
|
44
|
-
DEBUG = 0,
|
|
45
|
-
VERBOSE = 1,
|
|
46
|
-
INFO = 2,
|
|
47
|
-
WARN = 3,
|
|
48
|
-
ERROR = 4,
|
|
49
|
-
SILENT = 5
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* We allow users the ability to pass their own log handler. We will pass the
|
|
53
|
-
* type of log, the current log level, and any other arguments passed (i.e. the
|
|
54
|
-
* messages that the user wants to log) to this function.
|
|
55
|
-
*/
|
|
56
|
-
export
|
|
57
|
-
export declare class Logger {
|
|
58
|
-
name: string;
|
|
59
|
-
/**
|
|
60
|
-
* Gives you an instance of a Logger to capture messages according to
|
|
61
|
-
* Firebase's logging scheme.
|
|
62
|
-
*
|
|
63
|
-
* @param name The name that the logs will be associated with
|
|
64
|
-
*/
|
|
65
|
-
constructor(name: string);
|
|
66
|
-
/**
|
|
67
|
-
* The log level of the given Logger instance.
|
|
68
|
-
*/
|
|
69
|
-
private _logLevel;
|
|
70
|
-
get logLevel(): LogLevel;
|
|
71
|
-
set logLevel(val: LogLevel);
|
|
72
|
-
setLogLevel(val: LogLevel | LogLevelString): void;
|
|
73
|
-
/**
|
|
74
|
-
* The main (internal) log handler for the Logger instance.
|
|
75
|
-
* Can be set to a new function in internal package code but not by user.
|
|
76
|
-
*/
|
|
77
|
-
private _logHandler;
|
|
78
|
-
get logHandler(): LogHandler;
|
|
79
|
-
set logHandler(val: LogHandler);
|
|
80
|
-
/**
|
|
81
|
-
* The optional, additional, user-defined log handler for the Logger instance.
|
|
82
|
-
*/
|
|
83
|
-
private _userLogHandler;
|
|
84
|
-
get userLogHandler(): LogHandler | null;
|
|
85
|
-
set userLogHandler(val: LogHandler | null);
|
|
86
|
-
/**
|
|
87
|
-
* The functions below are all based on the `console` interface
|
|
88
|
-
*/
|
|
89
|
-
debug(...args: unknown[]): void;
|
|
90
|
-
log(...args: unknown[]): void;
|
|
91
|
-
info(...args: unknown[]): void;
|
|
92
|
-
warn(...args: unknown[]): void;
|
|
93
|
-
error(...args: unknown[]): void;
|
|
94
|
-
}
|
|
95
|
-
export declare function setLogLevel(level: LogLevelString | LogLevel): void;
|
|
96
|
-
export declare function setUserLogHandler(logCallback: LogCallback | null, options?: LogOptions): void;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent';
|
|
18
|
+
export interface LogOptions {
|
|
19
|
+
level: LogLevelString;
|
|
20
|
+
}
|
|
21
|
+
export type LogCallback = (callbackParams: LogCallbackParams) => void;
|
|
22
|
+
export interface LogCallbackParams {
|
|
23
|
+
level: LogLevelString;
|
|
24
|
+
message: string;
|
|
25
|
+
args: unknown[];
|
|
26
|
+
type: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A container for all of the Logger instances
|
|
30
|
+
*/
|
|
31
|
+
export declare const instances: Logger[];
|
|
32
|
+
/**
|
|
33
|
+
* The JS SDK supports 5 log levels and also allows a user the ability to
|
|
34
|
+
* silence the logs altogether.
|
|
35
|
+
*
|
|
36
|
+
* The order is a follows:
|
|
37
|
+
* DEBUG < VERBOSE < INFO < WARN < ERROR
|
|
38
|
+
*
|
|
39
|
+
* All of the log types above the current log level will be captured (i.e. if
|
|
40
|
+
* you set the log level to `INFO`, errors will still be logged, but `DEBUG` and
|
|
41
|
+
* `VERBOSE` logs will not)
|
|
42
|
+
*/
|
|
43
|
+
export declare enum LogLevel {
|
|
44
|
+
DEBUG = 0,
|
|
45
|
+
VERBOSE = 1,
|
|
46
|
+
INFO = 2,
|
|
47
|
+
WARN = 3,
|
|
48
|
+
ERROR = 4,
|
|
49
|
+
SILENT = 5
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* We allow users the ability to pass their own log handler. We will pass the
|
|
53
|
+
* type of log, the current log level, and any other arguments passed (i.e. the
|
|
54
|
+
* messages that the user wants to log) to this function.
|
|
55
|
+
*/
|
|
56
|
+
export type LogHandler = (loggerInstance: Logger, logType: LogLevel, ...args: unknown[]) => void;
|
|
57
|
+
export declare class Logger {
|
|
58
|
+
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* Gives you an instance of a Logger to capture messages according to
|
|
61
|
+
* Firebase's logging scheme.
|
|
62
|
+
*
|
|
63
|
+
* @param name The name that the logs will be associated with
|
|
64
|
+
*/
|
|
65
|
+
constructor(name: string);
|
|
66
|
+
/**
|
|
67
|
+
* The log level of the given Logger instance.
|
|
68
|
+
*/
|
|
69
|
+
private _logLevel;
|
|
70
|
+
get logLevel(): LogLevel;
|
|
71
|
+
set logLevel(val: LogLevel);
|
|
72
|
+
setLogLevel(val: LogLevel | LogLevelString): void;
|
|
73
|
+
/**
|
|
74
|
+
* The main (internal) log handler for the Logger instance.
|
|
75
|
+
* Can be set to a new function in internal package code but not by user.
|
|
76
|
+
*/
|
|
77
|
+
private _logHandler;
|
|
78
|
+
get logHandler(): LogHandler;
|
|
79
|
+
set logHandler(val: LogHandler);
|
|
80
|
+
/**
|
|
81
|
+
* The optional, additional, user-defined log handler for the Logger instance.
|
|
82
|
+
*/
|
|
83
|
+
private _userLogHandler;
|
|
84
|
+
get userLogHandler(): LogHandler | null;
|
|
85
|
+
set userLogHandler(val: LogHandler | null);
|
|
86
|
+
/**
|
|
87
|
+
* The functions below are all based on the `console` interface
|
|
88
|
+
*/
|
|
89
|
+
debug(...args: unknown[]): void;
|
|
90
|
+
log(...args: unknown[]): void;
|
|
91
|
+
info(...args: unknown[]): void;
|
|
92
|
+
warn(...args: unknown[]): void;
|
|
93
|
+
error(...args: unknown[]): void;
|
|
94
|
+
}
|
|
95
|
+
export declare function setLogLevel(level: LogLevelString | LogLevel): void;
|
|
96
|
+
export declare function setUserLogHandler(logCallback: LogCallback | null, options?: LogOptions): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2018 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2018 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|