Skip to content

Commit 846bf34

Browse files
committed
Undo previous changes and fix
1 parent 1c49eac commit 846bf34

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leekslazylogger",
3-
"version": "4.1.6",
3+
"version": "4.1.7",
44
"description": "An easy-to-use and lightweight logger for Node.js with colours, timestamps, and files.",
55
"main": "dist/",
66
"types": "types/index.d.ts",

src/index.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ import {
2020
import merge from '@eartharoid/deep-merge';
2121
import defaults from './defaults';
2222
import { relative } from 'path';
23-
import ConsoleTransport from './transports/console';
24-
import FileTransport from './transports/file';
23+
import * as transports from './transports';
2524
import { format } from 'util';
2625

27-
export default class Logger {
26+
module.exports = class Logger {
2827
public defaults: CompleteLoggerOptions;
2928
private _options: CompleteLoggerOptions;
3029
public levels: Array<string>;
@@ -55,7 +54,7 @@ export default class Logger {
5554
}
5655
}
5756

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

80-
get options(): CompleteLoggerOptions {
79+
get options() {
8180
return this._options;
8281
}
8382

84-
set options(options: PartialLoggerOptions) {
83+
set options(options) {
8584
this._options = merge(this._options, options);
8685
this._init();
8786
}
87+
};
8888

89-
static get transports() {
90-
return {
91-
ConsoleTransport,
92-
FileTransport,
93-
};
94-
}
95-
}
89+
module.exports.transports = transports;

0 commit comments

Comments
 (0)