@ayana/logger
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@ayana/logger", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Useful and great looking logging made easy", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -41,8 +41,8 @@ /* | ||
private constructor(name: string, pkgName: string, pkgPath: string): Logger; | ||
public log(level: LogLevel, msg: string): void; | ||
public error(msg: string): void; | ||
public warn(msg: string): void; | ||
public info(msg: string): void; | ||
public debug(msg: string): void; | ||
public trace(msg: string): void; | ||
public log(level: LogLevel, msg: string, uniqueMarker?: string): void; | ||
public error(msg: string, uniqueMarker?: string): void; | ||
public warn(msg: string, uniqueMarker?: string): void; | ||
public info(msg: string, uniqueMarker?: string): void; | ||
public debug(msg: string, uniqueMarker?: string): void; | ||
public trace(msg: string, uniqueMarker?: string): void; | ||
} | ||
@@ -49,0 +49,0 @@ |
@@ -116,4 +116,4 @@ /* | ||
for (const level of Object.keys(LogLevel)) { | ||
this[level.toLowerCase()] = msg => { | ||
this.log(level, msg); | ||
this[level.toLowerCase()] = (msg, uniqueMarker) => { | ||
this.log(level, msg, uniqueMarker); | ||
}; | ||
@@ -146,3 +146,3 @@ } | ||
log(level, msg) { | ||
log(level, msg, uniqueMarker) { | ||
this._updateLevel(); | ||
@@ -152,3 +152,7 @@ if (this.allowLevel === LogLevelValue.OFF || level === LogLevel.OFF) return; | ||
if (LogLevelValue[level] <= this.allowLevel) { | ||
winston.log(level, `[${colors.green(`${this.pkgName}:`)}${colors.blue(`${this.pkgPath}${this.name}`)}]: ${msg}`); | ||
winston.log( | ||
level, | ||
// eslint-disable-next-line max-len | ||
`[${colors.green(`${this.pkgName}:`)}${colors.blue(`${this.pkgPath}${this.name}`)}${uniqueMarker ? `/${colors.gray(`${uniqueMarker}`)}` : ''}]: ${msg}`, | ||
); | ||
} | ||
@@ -155,0 +159,0 @@ } |
21698
242