mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* [bristol] Added types for bristol logger * [bristol] made recommended changes for most common use cases
37 lines
1013 B
TypeScript
37 lines
1013 B
TypeScript
// Type definitions for bristol 0.4
|
|
// Project: https://github.com/TomFrost/Bristol
|
|
// Definitions by: Eric Heikes <https://github.com/eheikes>
|
|
// Elliott Campbell <https://github.com/ElliottCampbellJHA>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
// Caveat: Currently, .d.ts files are unable to handle this package fully
|
|
// as it requires both class and namespace be exported.
|
|
|
|
interface LogError {
|
|
message?: string;
|
|
reason?: any;
|
|
stack?: any;
|
|
}
|
|
|
|
interface LogData {
|
|
code?: number;
|
|
id?: string;
|
|
path?: string;
|
|
error?: LogError;
|
|
data?: any;
|
|
}
|
|
|
|
declare class Bristol {
|
|
addTarget(target: any, opts?: any): any;
|
|
withFormatter(formatter: string): any;
|
|
withLowestSeverity(severity: string): any;
|
|
info(message: string, data: LogData): any;
|
|
warn(message: string, data: LogData): any;
|
|
error(message: string, data: LogData): any;
|
|
debug(message: string, data: LogData): any;
|
|
}
|
|
|
|
declare const bristol: Bristol;
|
|
|
|
export = bristol;
|