mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Merge pull request #18727 from kryops/bunyan/nameFromLevel
[bunyan] add levelFromName and nameFromLevel
This commit is contained in:
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/LSEducation/bunyan-config
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="bunyan"/>
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/nemtsov/node-bunyan-logentries
|
||||
// Definitions by: Aymeric Beaumet <http://aymericbeaumet.me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -129,3 +129,8 @@ class MyLogger extends Logger {
|
||||
super(options);
|
||||
}
|
||||
}
|
||||
|
||||
const logLevelString: Logger.LogLevelString = 'warn';
|
||||
const nameLevel: number = Logger.levelFromName[logLevelString];
|
||||
const nameLevel2: number = Logger.levelFromName['warn'];
|
||||
const levelName: string = Logger.nameFromLevel[10];
|
||||
|
||||
Vendored
+6
-1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/trentm/node-bunyan
|
||||
// Definitions by: Alex Mikhalev <https://github.com/amikhalev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -210,7 +211,11 @@ declare namespace Logger {
|
||||
const ERROR: number;
|
||||
const FATAL: number;
|
||||
|
||||
type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | number;
|
||||
type LogLevelString = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
||||
type LogLevel = LogLevelString | number;
|
||||
|
||||
const levelFromName: { [name in LogLevelString]: number };
|
||||
const nameFromLevel: { [level: number]: string };
|
||||
|
||||
const stdSerializers: StdSerializers;
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/DeadAlready/easy-api-request
|
||||
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/DeadAlready/easy-xapi-utils
|
||||
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="easy-jsend" />
|
||||
/// <reference types="easy-x-headers" />
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/DeadAlready/easy-xapi
|
||||
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="easy-jsend" />
|
||||
/// <reference types="bunyan" />
|
||||
|
||||
Reference in New Issue
Block a user