@4lch4/logger
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,3 +5,3 @@ import { ILogger, ILoggerOpts } from './interfaces'; | ||
private ioUtil?; | ||
constructor(loggerOpts: ILoggerOpts); | ||
constructor(loggerOpts?: ILoggerOpts); | ||
info(msg: string): void; | ||
@@ -8,0 +8,0 @@ warn(msg: string): void; |
@@ -11,7 +11,7 @@ "use strict"; | ||
let formatOpt = lib_1.DefaultLogFormat; | ||
if (loggerOpts.format) | ||
if (loggerOpts === null || loggerOpts === void 0 ? void 0 : loggerOpts.format) | ||
formatOpt = loggerOpts.format; | ||
if (loggerOpts.colorOpts) | ||
if (loggerOpts === null || loggerOpts === void 0 ? void 0 : loggerOpts.colorOpts) | ||
colorOpts = loggerOpts.colorOpts; | ||
if (loggerOpts.logDir) { | ||
if (loggerOpts === null || loggerOpts === void 0 ? void 0 : loggerOpts.logDir) { | ||
this.ioUtil = new IOUtil_1.IOUtil(loggerOpts.logDir, loggerOpts.format); | ||
@@ -18,0 +18,0 @@ } |
{ | ||
"name": "@4lch4/logger", | ||
"displayName": "Logger", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A small utility for logging to console within NodeJS/TypeScript applications.", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
@@ -9,9 +9,9 @@ import { ILogger, ILoggerOpts, Level } from './interfaces' | ||
constructor(loggerOpts: ILoggerOpts) { | ||
constructor(loggerOpts?: ILoggerOpts) { | ||
let colorOpts = DefaultColors | ||
let formatOpt = DefaultLogFormat | ||
if (loggerOpts.format) formatOpt = loggerOpts.format | ||
if (loggerOpts.colorOpts) colorOpts = loggerOpts.colorOpts | ||
if (loggerOpts.logDir) { | ||
if (loggerOpts?.format) formatOpt = loggerOpts.format | ||
if (loggerOpts?.colorOpts) colorOpts = loggerOpts.colorOpts | ||
if (loggerOpts?.logDir) { | ||
this.ioUtil = new IOUtil(loggerOpts.logDir, loggerOpts.format) | ||
@@ -18,0 +18,0 @@ } |
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
41928