Fix lint warnings

This commit is contained in:
Yash-Singh1
2021-11-11 10:37:50 -08:00
parent d6782bced8
commit e68ec31a8f
4 changed files with 42 additions and 13 deletions

View File

@@ -1,12 +1,8 @@
import moment from 'moment-mini';
/**
* @typedef {"debug" | "info" | "warn" | "error" | "fatal"} LogLevel A log level
*/
/** @typedef {'debug' | 'info' | 'warn' | 'error' | 'fatal'} LogLevel A log level */
/**
* @type {Object<LogLevel, number>}
*/
/** @type {object<LogLevel, number>} */
export const LEVELS = {
debug: 1,
info: 2,
@@ -25,7 +21,8 @@ export const log = {
/**
* Sets a log level
* @param {LogLevel} [level="fatal"] The level to set the logging to
*
* @param {LogLevel} [level="fatal"] The level to set the logging to. Default is `"fatal"`
*/
export const setLogLevel = function (level = 'fatal') {
if (isNaN(level)) {
@@ -69,6 +66,7 @@ export const setLogLevel = function (level = 'fatal') {
/**
* Returns a format with the timestamp and the log level
*
* @param {LogLevel} level The level for the log format
* @returns {string} The format with the timestamp and log level
*/