loglevelnext
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -1,2 +0,2 @@ | ||
import { Factory, FactoryLevels } from './MethodFactory'; | ||
import { Factory, UnknownFactoryLevels } from './MethodFactory'; | ||
import { PrefixFactoryOptions } from './PrefixFactory'; | ||
@@ -28,4 +28,4 @@ declare type SomeLevel = number | string; | ||
set level(logLevel: SomeLevel); | ||
get levels(): FactoryLevels; | ||
get levels(): UnknownFactoryLevels; | ||
} | ||
export {}; |
@@ -5,3 +5,3 @@ import { LogLevel } from './LogLevel'; | ||
} | ||
export interface FactoryLevels extends Record<Uppercase<string>, number> { | ||
export interface UnknownFactoryLevels extends Record<Uppercase<string>, number> { | ||
SILENT: number; | ||
@@ -14,3 +14,3 @@ } | ||
levelValid: (level: number | string) => boolean; | ||
levels: FactoryLevels; | ||
levels: UnknownFactoryLevels; | ||
logger: LogLevel; | ||
@@ -21,6 +21,14 @@ make: (methodName: string) => Function; | ||
} | ||
export declare const MethodFactoryLevels: FactoryLevels; | ||
declare const BaseLevels: { | ||
TRACE: number; | ||
DEBUG: number; | ||
INFO: number; | ||
WARN: number; | ||
ERROR: number; | ||
SILENT: number; | ||
}; | ||
export declare type MethodFactoryLevels = Lowercase<keyof typeof BaseLevels>; | ||
export declare class MethodFactory implements Factory { | ||
constructor(logger?: LogLevel); | ||
get levels(): typeof MethodFactoryLevels; | ||
get levels(): typeof BaseLevels; | ||
get logger(): LogLevel; | ||
@@ -27,0 +35,0 @@ set logger(logger: LogLevel); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MethodFactory = exports.MethodFactoryLevels = void 0; | ||
exports.MethodFactory = void 0; | ||
const noop = () => { }; | ||
const levels = Symbol('log-levels'); | ||
const instance = Symbol('log-instance'); | ||
exports.MethodFactoryLevels = { | ||
const BaseLevels = { | ||
TRACE: 0, | ||
@@ -18,3 +18,3 @@ DEBUG: 1, | ||
this[instance] = logger; | ||
this[levels] = exports.MethodFactoryLevels; | ||
this[levels] = BaseLevels; | ||
} | ||
@@ -51,3 +51,4 @@ get levels() { | ||
let result = level; | ||
if (typeof result === 'string' && typeof this.levels[result.toUpperCase()] !== 'undefined') { | ||
if (typeof result === 'string' && | ||
typeof this.levels[result.toUpperCase()] !== 'undefined') { | ||
result = this.levels[result.toUpperCase()]; | ||
@@ -54,0 +55,0 @@ } |
{ | ||
"name": "loglevelnext", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "A modern logging library for Node.js and modern browsers that provides log level mapping to the console", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43071
353