@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.
@@ -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 declare type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent';
18
- export interface LogOptions {
19
- level: LogLevelString;
20
- }
21
- export declare 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 declare 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
+ /**
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/logger",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "A logger package for use in the Firebase JS SDK",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -37,7 +37,7 @@
37
37
  "devDependencies": {
38
38
  "rollup": "2.79.1",
39
39
  "rollup-plugin-typescript2": "0.31.2",
40
- "typescript": "4.7.4"
40
+ "typescript": "5.5.4"
41
41
  },
42
42
  "repository": {
43
43
  "directory": "packages/logger",