nighthouse
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -20,2 +20,4 @@ /** A log message severity. */ | ||
export declare class ConsoleLogHandler implements LogHandler { | ||
private readonly prefix; | ||
constructor(prefix?: string); | ||
log(level: LogLevel, msg: string): void; | ||
@@ -22,0 +24,0 @@ private formatLevel; |
@@ -22,4 +22,7 @@ "use strict"; | ||
class ConsoleLogHandler { | ||
constructor(prefix = '') { | ||
this.prefix = prefix; | ||
} | ||
log(level, msg) { | ||
const formatted = `[${this.formatLevel(level)}] ${msg}`; | ||
const formatted = `${this.prefix}[${this.formatLevel(level)}] ${msg}`; | ||
if (level >= LogLevel.Error) { | ||
@@ -26,0 +29,0 @@ console.error(formatted); |
{ | ||
"name": "nighthouse", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Lightweight Project Lighthouse client for JavaScript", | ||
@@ -5,0 +5,0 @@ "workspaces": [ |
@@ -25,4 +25,6 @@ /** A log message severity. */ | ||
export class ConsoleLogHandler implements LogHandler { | ||
constructor(private readonly prefix: string = '') {} | ||
log(level: LogLevel, msg: string): void { | ||
const formatted = `[${this.formatLevel(level)}] ${msg}`; | ||
const formatted = `${this.prefix}[${this.formatLevel(level)}] ${msg}`; | ||
if (level >= LogLevel.Error) { | ||
@@ -29,0 +31,0 @@ console.error(formatted); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
126362
1485