caterpillar
Advanced tools
Comparing version 6.0.0-next.1595532627.6289794b3247f5b3900d40babf4c3da8622171fa to 6.0.0-next.1595533872.80e0854f5864fa6a881c2e8f8360e3837d61e825
@@ -48,2 +48,4 @@ import { LevelInfo, LevelsMap } from 'rfc-log-levels' | ||
defaultLevelInfo: LevelInfo | ||
/** Set the default level info via a level number or name. */ | ||
set defaultLevel(value: number | string) | ||
/** | ||
@@ -50,0 +52,0 @@ * Only fetch line information for entries that have a log level equal to, or below this number. |
@@ -46,3 +46,3 @@ import getLogLevel, { rfcLogLevels } from 'rfc-log-levels' | ||
// options: default level | ||
const level = | ||
this.defaultLevel = | ||
(_a = opts === null || opts === void 0 ? void 0 : opts.defaultLevel) !== | ||
@@ -52,11 +52,14 @@ null && _a !== void 0 | ||
: 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
/** Set the default level info via a level number or name. */ | ||
set defaultLevel(value) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
@@ -63,0 +66,0 @@ /** Alias for {@link getLogLevel} using the configured logger levels as reference. */ |
@@ -69,2 +69,13 @@ import { __ as __fdPolyfill } from 'https://deno.land/x/dirname/mod.ts' | ||
/** Set the default level info via a level number or name. */ | ||
public set defaultLevel(value: number | string) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
} | ||
/** | ||
@@ -87,10 +98,3 @@ * Only fetch line information for entries that have a log level equal to, or below this number. | ||
// options: default level | ||
const level = opts?.defaultLevel ?? 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
this.defaultLevel = opts?.defaultLevel ?? 'info' | ||
@@ -97,0 +101,0 @@ // dereference |
@@ -91,3 +91,3 @@ 'use strict' | ||
// options: default level | ||
const level = | ||
this.defaultLevel = | ||
(_a = opts === null || opts === void 0 ? void 0 : opts.defaultLevel) !== | ||
@@ -97,11 +97,14 @@ null && _a !== void 0 | ||
: 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
/** Set the default level info via a level number or name. */ | ||
set defaultLevel(value) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
@@ -108,0 +111,0 @@ /** Alias for {@link getLogLevel} using the configured logger levels as reference. */ |
@@ -87,12 +87,15 @@ 'use strict' | ||
// options: default level | ||
const level = opts?.defaultLevel ?? 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
this.defaultLevel = opts?.defaultLevel ?? 'info' | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
/** Set the default level info via a level number or name. */ | ||
set defaultLevel(value) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
@@ -99,0 +102,0 @@ /** Alias for {@link getLogLevel} using the configured logger levels as reference. */ |
@@ -42,12 +42,15 @@ import getLogLevel, { rfcLogLevels } from 'rfc-log-levels' | ||
// options: default level | ||
const level = opts?.defaultLevel ?? 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
this.defaultLevel = opts?.defaultLevel ?? 'info' | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
/** Set the default level info via a level number or name. */ | ||
set defaultLevel(value) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
// dereference | ||
this.levels = Object.assign({}, this.levels) | ||
} | ||
@@ -54,0 +57,0 @@ /** Alias for {@link getLogLevel} using the configured logger levels as reference. */ |
{ | ||
"title": "Caterpillar", | ||
"name": "caterpillar", | ||
"version": "6.0.0-next.1595532627.6289794b3247f5b3900d40babf4c3da8622171fa", | ||
"version": "6.0.0-next.1595533872.80e0854f5864fa6a881c2e8f8360e3837d61e825", | ||
"description": "Caterpillar is the ultimate logging system for Deno, Node.js, and Web Browsers. Log levels are implemented to the RFC standard. Log entries can be filtered and piped to various streams, including coloured output to the terminal, the browser's console, and debug files. You can even write your own transforms.", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/bevry/caterpillar", |
@@ -60,2 +60,13 @@ import getLogLevel, { rfcLogLevels, LevelInfo, LevelsMap } from 'rfc-log-levels' | ||
/** Set the default level info via a level number or name. */ | ||
public set defaultLevel(value: number | string) { | ||
const levelInfo = this.getLogLevel(value) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${value} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
} | ||
/** | ||
@@ -78,10 +89,3 @@ * Only fetch line information for entries that have a log level equal to, or below this number. | ||
// options: default level | ||
const level = opts?.defaultLevel ?? 'info' | ||
const levelInfo = this.getLogLevel(level) | ||
if (levelInfo == null) { | ||
throw new Error( | ||
`caterpillar: the intended value of ${level} for the default log level not found in the configured levels` | ||
) | ||
} | ||
this.defaultLevelInfo = levelInfo | ||
this.defaultLevel = opts?.defaultLevel ?? 'info' | ||
@@ -88,0 +92,0 @@ // dereference |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
151798
3877
0