mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #31546 from TobyLi96/browser-bunyan-css
[browser-bunyan] Added css property to ConsoleFormattedStreamOptions
This commit is contained in:
@@ -23,3 +23,19 @@ const myObject = { x: 1, y: 2 };
|
||||
log.info({ obj: myObject }, 'This is my object:');
|
||||
|
||||
new bunyan.ConsoleFormattedStream({ logByLevel: true });
|
||||
|
||||
const style = {
|
||||
levels: {
|
||||
trace: 'color: DeepPink',
|
||||
debug: 'color: GoldenRod',
|
||||
info: 'color: DarkTurquoise',
|
||||
warn: 'color: Purple',
|
||||
error: 'color: Crimson',
|
||||
fatal: 'color: Black',
|
||||
},
|
||||
def: 'color: DimGray',
|
||||
msg: 'color: SteelBlue',
|
||||
src: 'color: DimGray; font-style: italic; font-size: 0.9em',
|
||||
};
|
||||
|
||||
new bunyan.ConsoleFormattedStream({ css: style });
|
||||
|
||||
Vendored
+19
-6
@@ -10,17 +10,30 @@
|
||||
import * as bunyan from 'bunyan';
|
||||
|
||||
declare namespace BrowserBunyan {
|
||||
interface ConsoleFormattedStreamLevelStyle {
|
||||
trace: string;
|
||||
debug: string;
|
||||
info: string;
|
||||
warn: string;
|
||||
error: string;
|
||||
fatal: string;
|
||||
}
|
||||
|
||||
interface ConsoleFormattedStreamStyle {
|
||||
levels: Partial<ConsoleFormattedStreamLevelStyle>;
|
||||
def: string;
|
||||
msg: string;
|
||||
src: string;
|
||||
}
|
||||
|
||||
interface ConsoleFormattedStreamOptions {
|
||||
logByLevel?: boolean;
|
||||
css?: Partial<ConsoleFormattedStreamStyle>;
|
||||
}
|
||||
|
||||
interface ConsoleFormattedStream {
|
||||
new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream;
|
||||
}
|
||||
type ConsoleFormattedStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream;
|
||||
|
||||
interface ConsoleRawStream {
|
||||
new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream;
|
||||
}
|
||||
type ConsoleRawStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream;
|
||||
}
|
||||
|
||||
type BrowserBunyan = typeof bunyan & {
|
||||
|
||||
Reference in New Issue
Block a user