@lage-run/logger
Advanced tools
Comparing version 1.1.3 to 1.2.0
/// <reference types="node" /> | ||
import type { LogStructuredData } from "./interfaces/LogStructuredData"; | ||
import type { LogEntry } from "./interfaces/LogEntry"; | ||
import type { Reporter } from "./interfaces/Reporter"; | ||
@@ -8,3 +7,2 @@ import { LogLevel } from "./interfaces/LogLevel"; | ||
reporters: Reporter[]; | ||
logs: LogEntry[]; | ||
log(level: LogLevel, msg: string, data?: TLogStructuredData): void; | ||
@@ -16,4 +14,4 @@ info(msg: string, data?: TLogStructuredData): void; | ||
silly(msg: string, data?: TLogStructuredData): void; | ||
stream(level: LogLevel, input: NodeJS.ReadableStream, data?: TLogStructuredData): void; | ||
stream(level: LogLevel, input: NodeJS.ReadableStream, data?: TLogStructuredData): () => void; | ||
addReporter(reporter: Reporter): void; | ||
} |
@@ -9,3 +9,2 @@ "use strict"; | ||
this.reporters = []; | ||
this.logs = []; | ||
} | ||
@@ -19,3 +18,2 @@ log(level, msg, data) { | ||
}; | ||
this.logs.push(entry); | ||
for (const reporter of this.reporters) { | ||
@@ -44,4 +42,12 @@ reporter.log(entry); | ||
crlfDelay: Infinity, | ||
terminal: false, | ||
}); | ||
readline.on("line", (line) => this.log(level, line, data)); | ||
const lineLogger = (line) => { | ||
this.log(level, line, data); | ||
}; | ||
readline.on("line", lineLogger); | ||
return () => { | ||
readline.off("line", lineLogger); | ||
readline.close(); | ||
}; | ||
} | ||
@@ -48,0 +54,0 @@ addReporter(reporter) { |
{ | ||
"name": "@lage-run/logger", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Logger for Lage", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
8342
138