mirror of
				https://github.com/musix-org/musix-oss
				synced 2025-11-04 06:49:31 +00:00 
			
		
		
		
	Updated
This commit is contained in:
		
							
								
								
									
										40
									
								
								node_modules/@firebase/logger/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								node_modules/@firebase/logger/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
# @firebase/logger
 | 
			
		||||
 | 
			
		||||
This package serves as the base of all logging in the JS SDK. Any logging that
 | 
			
		||||
is intended to be visible to Firebase end developers should go through this
 | 
			
		||||
module.
 | 
			
		||||
 | 
			
		||||
## Basic Usage
 | 
			
		||||
 | 
			
		||||
Firebase components should import the `Logger` class and instantiate a new
 | 
			
		||||
instance by passing a component name (e.g. `@firebase/<COMPONENT>`) to the
 | 
			
		||||
constructor.
 | 
			
		||||
 | 
			
		||||
_e.g._
 | 
			
		||||
 | 
			
		||||
```typescript
 | 
			
		||||
import { Logger } from '@firebase/logger';
 | 
			
		||||
 | 
			
		||||
const logClient = new Logger(`@firebase/<COMPONENT>`);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Each `Logger` instance supports 5 log functions each to be used in a specific
 | 
			
		||||
instance:
 | 
			
		||||
 | 
			
		||||
- `debug`: Internal logs; use this to allow developers to send us their debug
 | 
			
		||||
  logs for us to be able to diagnose an issue.
 | 
			
		||||
- `log`: Use to inform your user about things they may need to know.
 | 
			
		||||
- `info`: Use if you have to inform the user about something that they need to
 | 
			
		||||
  take a concrete action on. Once they take that action, the log should go away.
 | 
			
		||||
- `warn`: Use when a product feature may stop functioning correctly; unexpected
 | 
			
		||||
  scenario.
 | 
			
		||||
- `error`: Only use when user App would stop functioning correctly - super rare!
 | 
			
		||||
 | 
			
		||||
## Log Format
 | 
			
		||||
 | 
			
		||||
Each log will be formatted in the following manner:
 | 
			
		||||
 | 
			
		||||
```typescript
 | 
			
		||||
`[${new Date()}]  ${COMPONENT_NAME}: ${...args}`
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										190
									
								
								node_modules/@firebase/logger/dist/index.cjs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										190
									
								
								node_modules/@firebase/logger/dist/index.cjs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,190 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, '__esModule', { value: true });
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
/**
 | 
			
		||||
 * A container for all of the Logger instances
 | 
			
		||||
 */
 | 
			
		||||
var instances = [];
 | 
			
		||||
(function (LogLevel) {
 | 
			
		||||
    LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
 | 
			
		||||
    LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE";
 | 
			
		||||
    LogLevel[LogLevel["INFO"] = 2] = "INFO";
 | 
			
		||||
    LogLevel[LogLevel["WARN"] = 3] = "WARN";
 | 
			
		||||
    LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
 | 
			
		||||
    LogLevel[LogLevel["SILENT"] = 5] = "SILENT";
 | 
			
		||||
})(exports.LogLevel || (exports.LogLevel = {}));
 | 
			
		||||
/**
 | 
			
		||||
 * The default log level
 | 
			
		||||
 */
 | 
			
		||||
var defaultLogLevel = exports.LogLevel.INFO;
 | 
			
		||||
/**
 | 
			
		||||
 * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR
 | 
			
		||||
 * messages on to their corresponding console counterparts (if the log method
 | 
			
		||||
 * is supported by the current log level)
 | 
			
		||||
 */
 | 
			
		||||
var defaultLogHandler = function (instance, logType) {
 | 
			
		||||
    var args = [];
 | 
			
		||||
    for (var _i = 2; _i < arguments.length; _i++) {
 | 
			
		||||
        args[_i - 2] = arguments[_i];
 | 
			
		||||
    }
 | 
			
		||||
    if (logType < instance.logLevel) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    var now = new Date().toISOString();
 | 
			
		||||
    switch (logType) {
 | 
			
		||||
        /**
 | 
			
		||||
         * By default, `console.debug` is not displayed in the developer console (in
 | 
			
		||||
         * chrome). To avoid forcing users to have to opt-in to these logs twice
 | 
			
		||||
         * (i.e. once for firebase, and once in the console), we are sending `DEBUG`
 | 
			
		||||
         * logs to the `console.log` function.
 | 
			
		||||
         */
 | 
			
		||||
        case exports.LogLevel.DEBUG:
 | 
			
		||||
            console.log.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case exports.LogLevel.VERBOSE:
 | 
			
		||||
            console.log.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case exports.LogLevel.INFO:
 | 
			
		||||
            console.info.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case exports.LogLevel.WARN:
 | 
			
		||||
            console.warn.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case exports.LogLevel.ERROR:
 | 
			
		||||
            console.error.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error("Attempted to log a message with an invalid logType (value: " + logType + ")");
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
var Logger = /** @class */ (function () {
 | 
			
		||||
    /**
 | 
			
		||||
     * Gives you an instance of a Logger to capture messages according to
 | 
			
		||||
     * Firebase's logging scheme.
 | 
			
		||||
     *
 | 
			
		||||
     * @param name The name that the logs will be associated with
 | 
			
		||||
     */
 | 
			
		||||
    function Logger(name) {
 | 
			
		||||
        this.name = name;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log level of the given Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logLevel = defaultLogLevel;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log handler for the Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logHandler = defaultLogHandler;
 | 
			
		||||
        /**
 | 
			
		||||
         * Capture the current instance for later use
 | 
			
		||||
         */
 | 
			
		||||
        instances.push(this);
 | 
			
		||||
    }
 | 
			
		||||
    Object.defineProperty(Logger.prototype, "logLevel", {
 | 
			
		||||
        get: function () {
 | 
			
		||||
            return this._logLevel;
 | 
			
		||||
        },
 | 
			
		||||
        set: function (val) {
 | 
			
		||||
            if (!(val in exports.LogLevel)) {
 | 
			
		||||
                throw new TypeError('Invalid value assigned to `logLevel`');
 | 
			
		||||
            }
 | 
			
		||||
            this._logLevel = val;
 | 
			
		||||
        },
 | 
			
		||||
        enumerable: true,
 | 
			
		||||
        configurable: true
 | 
			
		||||
    });
 | 
			
		||||
    Object.defineProperty(Logger.prototype, "logHandler", {
 | 
			
		||||
        get: function () {
 | 
			
		||||
            return this._logHandler;
 | 
			
		||||
        },
 | 
			
		||||
        set: function (val) {
 | 
			
		||||
            if (typeof val !== 'function') {
 | 
			
		||||
                throw new TypeError('Value assigned to `logHandler` must be a function');
 | 
			
		||||
            }
 | 
			
		||||
            this._logHandler = val;
 | 
			
		||||
        },
 | 
			
		||||
        enumerable: true,
 | 
			
		||||
        configurable: true
 | 
			
		||||
    });
 | 
			
		||||
    /**
 | 
			
		||||
     * The functions below are all based on the `console` interface
 | 
			
		||||
     */
 | 
			
		||||
    Logger.prototype.debug = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, exports.LogLevel.DEBUG].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.log = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, exports.LogLevel.VERBOSE].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.info = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, exports.LogLevel.INFO].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.warn = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, exports.LogLevel.WARN].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.error = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, exports.LogLevel.ERROR].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    return Logger;
 | 
			
		||||
}());
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
function setLogLevel(level) {
 | 
			
		||||
    instances.forEach(function (inst) {
 | 
			
		||||
        inst.logLevel = level;
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.Logger = Logger;
 | 
			
		||||
exports.setLogLevel = setLogLevel;
 | 
			
		||||
//# sourceMappingURL=index.cjs.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/@firebase/logger/dist/index.cjs.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@firebase/logger/dist/index.cjs.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										19
									
								
								node_modules/@firebase/logger/dist/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								node_modules/@firebase/logger/dist/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
import { LogLevel } from './src/logger';
 | 
			
		||||
export declare function setLogLevel(level: LogLevel): void;
 | 
			
		||||
export { Logger, LogLevel, LogHandler } from './src/logger';
 | 
			
		||||
							
								
								
									
										197
									
								
								node_modules/@firebase/logger/dist/index.esm.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										197
									
								
								node_modules/@firebase/logger/dist/index.esm.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,197 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
/**
 | 
			
		||||
 * A container for all of the Logger instances
 | 
			
		||||
 */
 | 
			
		||||
var instances = [];
 | 
			
		||||
/**
 | 
			
		||||
 * The JS SDK supports 5 log levels and also allows a user the ability to
 | 
			
		||||
 * silence the logs altogether.
 | 
			
		||||
 *
 | 
			
		||||
 * The order is a follows:
 | 
			
		||||
 * DEBUG < VERBOSE < INFO < WARN < ERROR
 | 
			
		||||
 *
 | 
			
		||||
 * All of the log types above the current log level will be captured (i.e. if
 | 
			
		||||
 * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and
 | 
			
		||||
 * `VERBOSE` logs will not)
 | 
			
		||||
 */
 | 
			
		||||
var LogLevel;
 | 
			
		||||
(function (LogLevel) {
 | 
			
		||||
    LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
 | 
			
		||||
    LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE";
 | 
			
		||||
    LogLevel[LogLevel["INFO"] = 2] = "INFO";
 | 
			
		||||
    LogLevel[LogLevel["WARN"] = 3] = "WARN";
 | 
			
		||||
    LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
 | 
			
		||||
    LogLevel[LogLevel["SILENT"] = 5] = "SILENT";
 | 
			
		||||
})(LogLevel || (LogLevel = {}));
 | 
			
		||||
/**
 | 
			
		||||
 * The default log level
 | 
			
		||||
 */
 | 
			
		||||
var defaultLogLevel = LogLevel.INFO;
 | 
			
		||||
/**
 | 
			
		||||
 * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR
 | 
			
		||||
 * messages on to their corresponding console counterparts (if the log method
 | 
			
		||||
 * is supported by the current log level)
 | 
			
		||||
 */
 | 
			
		||||
var defaultLogHandler = function (instance, logType) {
 | 
			
		||||
    var args = [];
 | 
			
		||||
    for (var _i = 2; _i < arguments.length; _i++) {
 | 
			
		||||
        args[_i - 2] = arguments[_i];
 | 
			
		||||
    }
 | 
			
		||||
    if (logType < instance.logLevel) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    var now = new Date().toISOString();
 | 
			
		||||
    switch (logType) {
 | 
			
		||||
        /**
 | 
			
		||||
         * By default, `console.debug` is not displayed in the developer console (in
 | 
			
		||||
         * chrome). To avoid forcing users to have to opt-in to these logs twice
 | 
			
		||||
         * (i.e. once for firebase, and once in the console), we are sending `DEBUG`
 | 
			
		||||
         * logs to the `console.log` function.
 | 
			
		||||
         */
 | 
			
		||||
        case LogLevel.DEBUG:
 | 
			
		||||
            console.log.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.VERBOSE:
 | 
			
		||||
            console.log.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.INFO:
 | 
			
		||||
            console.info.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.WARN:
 | 
			
		||||
            console.warn.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.ERROR:
 | 
			
		||||
            console.error.apply(console, ["[" + now + "]  " + instance.name + ":"].concat(args));
 | 
			
		||||
            break;
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error("Attempted to log a message with an invalid logType (value: " + logType + ")");
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
var Logger = /** @class */ (function () {
 | 
			
		||||
    /**
 | 
			
		||||
     * Gives you an instance of a Logger to capture messages according to
 | 
			
		||||
     * Firebase's logging scheme.
 | 
			
		||||
     *
 | 
			
		||||
     * @param name The name that the logs will be associated with
 | 
			
		||||
     */
 | 
			
		||||
    function Logger(name) {
 | 
			
		||||
        this.name = name;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log level of the given Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logLevel = defaultLogLevel;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log handler for the Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logHandler = defaultLogHandler;
 | 
			
		||||
        /**
 | 
			
		||||
         * Capture the current instance for later use
 | 
			
		||||
         */
 | 
			
		||||
        instances.push(this);
 | 
			
		||||
    }
 | 
			
		||||
    Object.defineProperty(Logger.prototype, "logLevel", {
 | 
			
		||||
        get: function () {
 | 
			
		||||
            return this._logLevel;
 | 
			
		||||
        },
 | 
			
		||||
        set: function (val) {
 | 
			
		||||
            if (!(val in LogLevel)) {
 | 
			
		||||
                throw new TypeError('Invalid value assigned to `logLevel`');
 | 
			
		||||
            }
 | 
			
		||||
            this._logLevel = val;
 | 
			
		||||
        },
 | 
			
		||||
        enumerable: true,
 | 
			
		||||
        configurable: true
 | 
			
		||||
    });
 | 
			
		||||
    Object.defineProperty(Logger.prototype, "logHandler", {
 | 
			
		||||
        get: function () {
 | 
			
		||||
            return this._logHandler;
 | 
			
		||||
        },
 | 
			
		||||
        set: function (val) {
 | 
			
		||||
            if (typeof val !== 'function') {
 | 
			
		||||
                throw new TypeError('Value assigned to `logHandler` must be a function');
 | 
			
		||||
            }
 | 
			
		||||
            this._logHandler = val;
 | 
			
		||||
        },
 | 
			
		||||
        enumerable: true,
 | 
			
		||||
        configurable: true
 | 
			
		||||
    });
 | 
			
		||||
    /**
 | 
			
		||||
     * The functions below are all based on the `console` interface
 | 
			
		||||
     */
 | 
			
		||||
    Logger.prototype.debug = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, LogLevel.DEBUG].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.log = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, LogLevel.VERBOSE].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.info = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, LogLevel.INFO].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.warn = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, LogLevel.WARN].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    Logger.prototype.error = function () {
 | 
			
		||||
        var args = [];
 | 
			
		||||
        for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
            args[_i] = arguments[_i];
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler.apply(this, [this, LogLevel.ERROR].concat(args));
 | 
			
		||||
    };
 | 
			
		||||
    return Logger;
 | 
			
		||||
}());
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
function setLogLevel(level) {
 | 
			
		||||
    instances.forEach(function (inst) {
 | 
			
		||||
        inst.logLevel = level;
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export { LogLevel, Logger, setLogLevel };
 | 
			
		||||
//# sourceMappingURL=index.esm.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/@firebase/logger/dist/index.esm.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@firebase/logger/dist/index.esm.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										164
									
								
								node_modules/@firebase/logger/dist/index.esm2017.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										164
									
								
								node_modules/@firebase/logger/dist/index.esm2017.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,164 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
/**
 | 
			
		||||
 * A container for all of the Logger instances
 | 
			
		||||
 */
 | 
			
		||||
const instances = [];
 | 
			
		||||
/**
 | 
			
		||||
 * The JS SDK supports 5 log levels and also allows a user the ability to
 | 
			
		||||
 * silence the logs altogether.
 | 
			
		||||
 *
 | 
			
		||||
 * The order is a follows:
 | 
			
		||||
 * DEBUG < VERBOSE < INFO < WARN < ERROR
 | 
			
		||||
 *
 | 
			
		||||
 * All of the log types above the current log level will be captured (i.e. if
 | 
			
		||||
 * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and
 | 
			
		||||
 * `VERBOSE` logs will not)
 | 
			
		||||
 */
 | 
			
		||||
var LogLevel;
 | 
			
		||||
(function (LogLevel) {
 | 
			
		||||
    LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
 | 
			
		||||
    LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE";
 | 
			
		||||
    LogLevel[LogLevel["INFO"] = 2] = "INFO";
 | 
			
		||||
    LogLevel[LogLevel["WARN"] = 3] = "WARN";
 | 
			
		||||
    LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
 | 
			
		||||
    LogLevel[LogLevel["SILENT"] = 5] = "SILENT";
 | 
			
		||||
})(LogLevel || (LogLevel = {}));
 | 
			
		||||
/**
 | 
			
		||||
 * The default log level
 | 
			
		||||
 */
 | 
			
		||||
const defaultLogLevel = LogLevel.INFO;
 | 
			
		||||
/**
 | 
			
		||||
 * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR
 | 
			
		||||
 * messages on to their corresponding console counterparts (if the log method
 | 
			
		||||
 * is supported by the current log level)
 | 
			
		||||
 */
 | 
			
		||||
const defaultLogHandler = (instance, logType, ...args) => {
 | 
			
		||||
    if (logType < instance.logLevel) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    const now = new Date().toISOString();
 | 
			
		||||
    switch (logType) {
 | 
			
		||||
        /**
 | 
			
		||||
         * By default, `console.debug` is not displayed in the developer console (in
 | 
			
		||||
         * chrome). To avoid forcing users to have to opt-in to these logs twice
 | 
			
		||||
         * (i.e. once for firebase, and once in the console), we are sending `DEBUG`
 | 
			
		||||
         * logs to the `console.log` function.
 | 
			
		||||
         */
 | 
			
		||||
        case LogLevel.DEBUG:
 | 
			
		||||
            console.log(`[${now}]  ${instance.name}:`, ...args);
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.VERBOSE:
 | 
			
		||||
            console.log(`[${now}]  ${instance.name}:`, ...args);
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.INFO:
 | 
			
		||||
            console.info(`[${now}]  ${instance.name}:`, ...args);
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.WARN:
 | 
			
		||||
            console.warn(`[${now}]  ${instance.name}:`, ...args);
 | 
			
		||||
            break;
 | 
			
		||||
        case LogLevel.ERROR:
 | 
			
		||||
            console.error(`[${now}]  ${instance.name}:`, ...args);
 | 
			
		||||
            break;
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
class Logger {
 | 
			
		||||
    /**
 | 
			
		||||
     * Gives you an instance of a Logger to capture messages according to
 | 
			
		||||
     * Firebase's logging scheme.
 | 
			
		||||
     *
 | 
			
		||||
     * @param name The name that the logs will be associated with
 | 
			
		||||
     */
 | 
			
		||||
    constructor(name) {
 | 
			
		||||
        this.name = name;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log level of the given Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logLevel = defaultLogLevel;
 | 
			
		||||
        /**
 | 
			
		||||
         * The log handler for the Logger instance.
 | 
			
		||||
         */
 | 
			
		||||
        this._logHandler = defaultLogHandler;
 | 
			
		||||
        /**
 | 
			
		||||
         * Capture the current instance for later use
 | 
			
		||||
         */
 | 
			
		||||
        instances.push(this);
 | 
			
		||||
    }
 | 
			
		||||
    get logLevel() {
 | 
			
		||||
        return this._logLevel;
 | 
			
		||||
    }
 | 
			
		||||
    set logLevel(val) {
 | 
			
		||||
        if (!(val in LogLevel)) {
 | 
			
		||||
            throw new TypeError('Invalid value assigned to `logLevel`');
 | 
			
		||||
        }
 | 
			
		||||
        this._logLevel = val;
 | 
			
		||||
    }
 | 
			
		||||
    get logHandler() {
 | 
			
		||||
        return this._logHandler;
 | 
			
		||||
    }
 | 
			
		||||
    set logHandler(val) {
 | 
			
		||||
        if (typeof val !== 'function') {
 | 
			
		||||
            throw new TypeError('Value assigned to `logHandler` must be a function');
 | 
			
		||||
        }
 | 
			
		||||
        this._logHandler = val;
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
     * The functions below are all based on the `console` interface
 | 
			
		||||
     */
 | 
			
		||||
    debug(...args) {
 | 
			
		||||
        this._logHandler(this, LogLevel.DEBUG, ...args);
 | 
			
		||||
    }
 | 
			
		||||
    log(...args) {
 | 
			
		||||
        this._logHandler(this, LogLevel.VERBOSE, ...args);
 | 
			
		||||
    }
 | 
			
		||||
    info(...args) {
 | 
			
		||||
        this._logHandler(this, LogLevel.INFO, ...args);
 | 
			
		||||
    }
 | 
			
		||||
    warn(...args) {
 | 
			
		||||
        this._logHandler(this, LogLevel.WARN, ...args);
 | 
			
		||||
    }
 | 
			
		||||
    error(...args) {
 | 
			
		||||
        this._logHandler(this, LogLevel.ERROR, ...args);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
function setLogLevel(level) {
 | 
			
		||||
    instances.forEach(inst => {
 | 
			
		||||
        inst.logLevel = level;
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export { LogLevel, Logger, setLogLevel };
 | 
			
		||||
//# sourceMappingURL=index.esm2017.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/@firebase/logger/dist/index.esm2017.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@firebase/logger/dist/index.esm2017.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										73
									
								
								node_modules/@firebase/logger/dist/src/logger.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								node_modules/@firebase/logger/dist/src/logger.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @license
 | 
			
		||||
 * Copyright 2017 Google Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
/**
 | 
			
		||||
 * A container for all of the Logger instances
 | 
			
		||||
 */
 | 
			
		||||
export declare const instances: Logger[];
 | 
			
		||||
/**
 | 
			
		||||
 * The JS SDK supports 5 log levels and also allows a user the ability to
 | 
			
		||||
 * silence the logs altogether.
 | 
			
		||||
 *
 | 
			
		||||
 * The order is a follows:
 | 
			
		||||
 * DEBUG < VERBOSE < INFO < WARN < ERROR
 | 
			
		||||
 *
 | 
			
		||||
 * All of the log types above the current log level will be captured (i.e. if
 | 
			
		||||
 * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and
 | 
			
		||||
 * `VERBOSE` logs will not)
 | 
			
		||||
 */
 | 
			
		||||
export declare enum LogLevel {
 | 
			
		||||
    DEBUG = 0,
 | 
			
		||||
    VERBOSE = 1,
 | 
			
		||||
    INFO = 2,
 | 
			
		||||
    WARN = 3,
 | 
			
		||||
    ERROR = 4,
 | 
			
		||||
    SILENT = 5
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * We allow users the ability to pass their own log handler. We will pass the
 | 
			
		||||
 * type of log, the current log level, and any other arguments passed (i.e. the
 | 
			
		||||
 * messages that the user wants to log) to this function.
 | 
			
		||||
 */
 | 
			
		||||
export declare type LogHandler = (loggerInstance: Logger, logType: LogLevel, ...args: unknown[]) => void;
 | 
			
		||||
export declare class Logger {
 | 
			
		||||
    name: string;
 | 
			
		||||
    /**
 | 
			
		||||
     * Gives you an instance of a Logger to capture messages according to
 | 
			
		||||
     * Firebase's logging scheme.
 | 
			
		||||
     *
 | 
			
		||||
     * @param name The name that the logs will be associated with
 | 
			
		||||
     */
 | 
			
		||||
    constructor(name: string);
 | 
			
		||||
    /**
 | 
			
		||||
     * The log level of the given Logger instance.
 | 
			
		||||
     */
 | 
			
		||||
    private _logLevel;
 | 
			
		||||
    logLevel: LogLevel;
 | 
			
		||||
    /**
 | 
			
		||||
     * The log handler for the Logger instance.
 | 
			
		||||
     */
 | 
			
		||||
    private _logHandler;
 | 
			
		||||
    logHandler: LogHandler;
 | 
			
		||||
    /**
 | 
			
		||||
     * The functions below are all based on the `console` interface
 | 
			
		||||
     */
 | 
			
		||||
    debug(...args: unknown[]): void;
 | 
			
		||||
    log(...args: unknown[]): void;
 | 
			
		||||
    info(...args: unknown[]): void;
 | 
			
		||||
    warn(...args: unknown[]): void;
 | 
			
		||||
    error(...args: unknown[]): void;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										102
									
								
								node_modules/@firebase/logger/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								node_modules/@firebase/logger/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,102 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "@firebase/logger@0.1.24",
 | 
			
		||||
  "_id": "@firebase/logger@0.1.24",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha512-wPwhWCepEjWiTIqeC9U+7Hcw4XwezKPdXmyXbYSPiWNDcVekNgMPkntwSK+/2ufJO/1nMwAL2n6fL12oQG/PpQ==",
 | 
			
		||||
  "_location": "/@firebase/logger",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "version",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "@firebase/logger@0.1.24",
 | 
			
		||||
    "name": "@firebase/logger",
 | 
			
		||||
    "escapedName": "@firebase%2flogger",
 | 
			
		||||
    "scope": "@firebase",
 | 
			
		||||
    "rawSpec": "0.1.24",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "0.1.24"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/@firebase/app",
 | 
			
		||||
    "/@firebase/database",
 | 
			
		||||
    "/@firebase/firestore",
 | 
			
		||||
    "/@firebase/performance"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.24.tgz",
 | 
			
		||||
  "_shasum": "770468c9f6c910c0db6008f7dccad88bb1df06d6",
 | 
			
		||||
  "_spec": "@firebase/logger@0.1.24",
 | 
			
		||||
  "_where": "C:\\Users\\matia\\Documents\\GitHub\\FutoX-Musix\\node_modules\\@firebase\\app",
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Firebase",
 | 
			
		||||
    "email": "firebase-support@google.com",
 | 
			
		||||
    "url": "https://firebase.google.com/"
 | 
			
		||||
  },
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/firebase/firebase-js-sdk/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "A logger package for use in the Firebase JS SDK",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/chai": "4.2.0",
 | 
			
		||||
    "@types/mocha": "5.2.7",
 | 
			
		||||
    "@types/sinon": "7.0.13",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "2.0.0",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin-tslint": "2.0.0",
 | 
			
		||||
    "@typescript-eslint/parser": "2.0.0",
 | 
			
		||||
    "chai": "4.2.0",
 | 
			
		||||
    "eslint": "5.16.0",
 | 
			
		||||
    "eslint-plugin-import": "2.18.2",
 | 
			
		||||
    "karma": "4.3.0",
 | 
			
		||||
    "karma-chrome-launcher": "3.1.0",
 | 
			
		||||
    "karma-cli": "2.0.0",
 | 
			
		||||
    "karma-firefox-launcher": "1.2.0",
 | 
			
		||||
    "karma-mocha": "1.3.0",
 | 
			
		||||
    "karma-sauce-launcher": "1.2.0",
 | 
			
		||||
    "karma-spec-reporter": "0.0.32",
 | 
			
		||||
    "karma-webpack": "4.0.2",
 | 
			
		||||
    "mocha": "6.2.0",
 | 
			
		||||
    "npm-run-all": "4.1.5",
 | 
			
		||||
    "nyc": "14.1.1",
 | 
			
		||||
    "rollup": "1.20.3",
 | 
			
		||||
    "rollup-plugin-typescript2": "0.24.0",
 | 
			
		||||
    "sinon": "7.4.1",
 | 
			
		||||
    "ts-loader": "6.0.4",
 | 
			
		||||
    "ts-node": "8.3.0",
 | 
			
		||||
    "typescript": "3.5.3",
 | 
			
		||||
    "webpack": "4.39.3"
 | 
			
		||||
  },
 | 
			
		||||
  "esm2017": "dist/index.esm2017.js",
 | 
			
		||||
  "files": [
 | 
			
		||||
    "dist"
 | 
			
		||||
  ],
 | 
			
		||||
  "homepage": "https://github.com/firebase/firebase-js-sdk#readme",
 | 
			
		||||
  "license": "Apache-2.0",
 | 
			
		||||
  "main": "dist/index.cjs.js",
 | 
			
		||||
  "module": "dist/index.esm.js",
 | 
			
		||||
  "name": "@firebase/logger",
 | 
			
		||||
  "nyc": {
 | 
			
		||||
    "extension": [
 | 
			
		||||
      ".ts"
 | 
			
		||||
    ],
 | 
			
		||||
    "reportDir": "./coverage/node"
 | 
			
		||||
  },
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "directory": "packages/logger",
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git+https://github.com/firebase/firebase-js-sdk.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "build": "rollup -c",
 | 
			
		||||
    "dev": "rollup -c -w",
 | 
			
		||||
    "lint": "eslint -c .eslintrc.json '**/*.ts' --ignore-path '../../.gitignore'",
 | 
			
		||||
    "lint:fix": "eslint --fix -c .eslintrc.json '**/*.ts' --ignore-path '../../.gitignore'",
 | 
			
		||||
    "prepare": "yarn build",
 | 
			
		||||
    "test": "run-p lint test:browser test:node",
 | 
			
		||||
    "test:browser": "karma start --single-run",
 | 
			
		||||
    "test:browser:debug": "karma start --browsers Chrome --auto-watch",
 | 
			
		||||
    "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts"
 | 
			
		||||
  },
 | 
			
		||||
  "typings": "dist/index.d.ts",
 | 
			
		||||
  "version": "0.1.24"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user