Skip to content

Commit

Permalink
Undo previous changes and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Mar 18, 2022
1 parent 1c49eac commit 846bf34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leekslazylogger",
"version": "4.1.6",
"version": "4.1.7",
"description": "An easy-to-use and lightweight logger for Node.js with colours, timestamps, and files.",
"main": "dist/",
"types": "types/index.d.ts",
Expand Down
20 changes: 7 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ import {
import merge from '@eartharoid/deep-merge';
import defaults from './defaults';
import { relative } from 'path';
import ConsoleTransport from './transports/console';
import FileTransport from './transports/file';
import * as transports from './transports';
import { format } from 'util';

export default class Logger {
module.exports = class Logger {
public defaults: CompleteLoggerOptions;
private _options: CompleteLoggerOptions;
public levels: Array<string>;
Expand Down Expand Up @@ -55,7 +54,7 @@ export default class Logger {
}
}

public log(namespace: string | null, level: LogLevel, ...content: LogContent): void {
public log(namespace: string | null, level: LogLevel, ...content: LogContent) {
const _prepareStackTrace = Error.prepareStackTrace; // eslint-disable-line no-underscore-dangle
Error.prepareStackTrace = (_, stack) => stack;
const stack = <Array<CallSite> | undefined>new Error().stack;
Expand All @@ -77,19 +76,14 @@ export default class Logger {
}
}

get options(): CompleteLoggerOptions {
get options() {
return this._options;
}

set options(options: PartialLoggerOptions) {
set options(options) {
this._options = merge(this._options, options);
this._init();
}
};

static get transports() {
return {
ConsoleTransport,
FileTransport,
};
}
}
module.exports.transports = transports;

0 comments on commit 846bf34

Please sign in to comment.