Comparing version 7.5.0 to 7.6.0
import { logLevels } from './constants'; | ||
import { getLogLevelName } from './getLogLevelName'; | ||
import type { RoarrGlobalState } from './types'; | ||
declare const ROARR: RoarrGlobalState; | ||
declare const Roarr: import("./types").Logger; | ||
export type { Logger, Message, MessageEventHandler, RoarrGlobalState, TranslateMessageFunction, } from './types'; | ||
export { logLevels, Roarr, ROARR, }; | ||
export type { Logger, LogLevelName, Message, MessageEventHandler, RoarrGlobalState, TranslateMessageFunction, } from './types'; | ||
export { getLogLevelName, logLevels, Roarr, ROARR, }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ROARR = exports.Roarr = exports.logLevels = void 0; | ||
exports.ROARR = exports.Roarr = exports.logLevels = exports.getLogLevelName = void 0; | ||
const globalthis_1 = __importDefault(require("globalthis")); | ||
@@ -13,2 +13,4 @@ const constants_1 = require("./constants"); | ||
const createRoarrInitialGlobalStateBrowser_1 = require("./factories/createRoarrInitialGlobalStateBrowser"); | ||
const getLogLevelName_1 = require("./getLogLevelName"); | ||
Object.defineProperty(exports, "getLogLevelName", { enumerable: true, get: function () { return getLogLevelName_1.getLogLevelName; } }); | ||
const globalThis = (0, globalthis_1.default)(); | ||
@@ -15,0 +17,0 @@ const ROARR = globalThis.ROARR = (0, createRoarrInitialGlobalStateBrowser_1.createRoarrInitialGlobalStateBrowser)(globalThis.ROARR || {}); |
import { logLevels } from './constants'; | ||
import { getLogLevelName } from './getLogLevelName'; | ||
import type { RoarrGlobalState } from './types'; | ||
declare const ROARR: RoarrGlobalState; | ||
declare const Roarr: import("./types").Logger; | ||
export type { Logger, LogWriter, Message, MessageEventHandler, RoarrGlobalState, TranslateMessageFunction, } from './types'; | ||
export { logLevels, Roarr, ROARR, }; | ||
export type { Logger, LogLevelName, LogWriter, Message, MessageEventHandler, RoarrGlobalState, TranslateMessageFunction, } from './types'; | ||
export { getLogLevelName, logLevels, Roarr, ROARR, }; |
@@ -7,3 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ROARR = exports.Roarr = exports.logLevels = void 0; | ||
exports.ROARR = exports.Roarr = exports.logLevels = exports.getLogLevelName = void 0; | ||
const boolean_1 = require("boolean"); | ||
@@ -17,2 +17,4 @@ const fast_json_stringify_1 = __importDefault(require("fast-json-stringify")); | ||
const createRoarrInitialGlobalState_1 = require("./factories/createRoarrInitialGlobalState"); | ||
const getLogLevelName_1 = require("./getLogLevelName"); | ||
Object.defineProperty(exports, "getLogLevelName", { enumerable: true, get: function () { return getLogLevelName_1.getLogLevelName; } }); | ||
const stringify = (0, fast_json_stringify_1.default)({ | ||
@@ -19,0 +21,0 @@ properties: { |
@@ -40,1 +40,2 @@ /// <reference types="node" /> | ||
export declare type MessageEventHandler = (message: Message) => void; | ||
export declare type LogLevelName = 'trace' | 'debug' | 'info' | 'error' | 'fatal' | 'warn'; |
@@ -76,3 +76,3 @@ { | ||
"typings": "./dist/src/Roarr.d.ts", | ||
"version": "7.5.0" | ||
"version": "7.6.0" | ||
} |
@@ -29,2 +29,4 @@ <a name="roarr"></a> | ||
* [`fatal`](#roarr-api-fatal) | ||
* [Utilities](#roarr-utilities) | ||
* [`getLogLevelName`](#roarr-utilities-getloglevelname) | ||
* [Middlewares](#roarr-middlewares) | ||
@@ -489,2 +491,24 @@ * [CLI program](#roarr-cli-program) | ||
<a name="roarr-utilities"></a> | ||
## Utilities | ||
<a name="roarr-utilities-getloglevelname"></a> | ||
### <code>getLogLevelName</code> | ||
Provides log level name (trace, debug, ...) for a numeric log level (10, 20, ...). | ||
If numeric log level is between two ranges, then resolves to the one with greater severity (e.g. 5 => trace). | ||
If numeric log level is greater than the maximum supported, then falls back to the greatest severity (fatal). | ||
```js | ||
import { | ||
getLogLevelName, | ||
} from 'roarr'; | ||
import type { | ||
LogLevelName, | ||
} from 'roarr'; | ||
getLogLevelName(numericLogLevel: number): LogLevelName; | ||
``` | ||
<a name="roarr-middlewares"></a> | ||
@@ -491,0 +515,0 @@ ## Middlewares |
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
77793
38
1542
799