mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-14 23:26:18 +00:00
73 lines
2.2 KiB
TypeScript
73 lines
2.2 KiB
TypeScript
|
/**
|
||
|
* 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: any[]) => 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: any[]): void;
|
||
|
log(...args: any[]): void;
|
||
|
info(...args: any[]): void;
|
||
|
warn(...args: any[]): void;
|
||
|
error(...args: any[]): void;
|
||
|
}
|