logxpert 1.0.4-0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,113 +1,97 @@
1
- # LogXpert
2
-
3
- LogXpert is a powerful logging library for Node.js that provides easy-to-use logging methods with colorful formatted output and optional file logging support
4
-
5
- ## Table of Contents
6
- - [Installation](#installation)
7
- - [Usage](#usage)
8
- - [Basic Logging](#basic-logging)
9
- - [Advanced Logging: File Output & Custom Console Timestamp](#advanced-logging-file-output--custom-console-timestamp)
10
- - [API Reference](#api-reference)
11
- - [Additional Information](#additional-information)
12
- - [License](#license)
13
-
14
- ## Installation
15
-
16
- You can install LogXpert using npm:
17
-
18
- ```sh
19
- npm install logxpert
20
- ```
21
-
22
- ## Usage
23
-
24
- ### Basic Logging
25
-
26
- Import LogXpert in your project and use it to log messages:
27
-
28
- ```js
29
- const log = require('logxpert');
30
-
31
- // Log a general message
32
- log('This is a general log message.');
33
-
34
- // Log an error message
35
- log.error('This is an error message.');
36
-
37
- // Log a warning message
38
- log.warn('This is a warning message.');
39
-
40
- // Log an informational message
41
- log.info('This is an informational message.');
42
-
43
- // Log a debug message
44
- log.debug('This is a debug message.');
45
- ```
46
-
47
- ### Advanced Logging: File Output & Custom Console Timestamp
48
-
49
- LogXpert supports file logging using [winston](https://github.com/winstonjs/winston) and [winston-daily-rotate-file](https://github.com/winstonjs/winston-daily-rotate-file).
50
-
51
- Example configuration:
52
-
53
- ```js
54
- const log = require('logxpert');
55
-
56
- log.settings({
57
- console: {
58
- enableTimestamp: true,
59
- // You can now include decoration characters as desired:
60
- timestampFormat: "This is the date: [YYYY-MM-DD HH:mm:ss] - ",
61
- timestampPrefix: '',
62
- timestampSuffix: ''
63
- },
64
- files: {
65
- folder: 'logs',
66
- filesName: 'YYYY-MM-DD',
67
- maxFile: '14d',
68
- maxSize: '20m',
69
- zippedArchive: false
70
- }
71
- });
72
- ```
73
-
74
- ## API Reference
75
-
76
- - **log(message: string):**
77
- Logs a general message using the `info` level.
78
-
79
- - **log.error(message: string):**
80
- Logs an error message.
81
-
82
- - **log.warn(message: string):**
83
- Logs a warning message.
84
-
85
- - **log.info(message: string):**
86
- Logs an informational message.
87
-
88
- - **log.debug(message: string):**
89
- Logs a debug message.
90
-
91
- - **log.settings(options: object):**
92
- Configures file logging and console output options.
93
- **Console Options:**
94
- - `enableTimestamp` (boolean): Enable/disable timestamp (default: `true`).
95
- - `timestampFormat` (string): Format for the timestamp including any desired literal text or decoration (default: `'YYYY-MM-DD HH:mm:ss'`).
96
- - `timestampPrefix` (string): Prefix for the timestamp.
97
- - `timestampSuffix` (string): Suffix for the timestamp.
98
-
99
- **Files Options:**
100
- - `folder` (string): Directory where log files will be stored (default: `'logs'`).
101
- - `filesName` (string): Date pattern for the log file name (default: `'YYYY-MM-DD'`).
102
- - `maxFile` (string): Maximum file retention (default: `'14d'`).
103
- - `maxSize` (string): Maximum size per log file (default: `'20m'`).
104
- - `zippedArchive` (boolean): Archive logs in zip format (default: `false`).
105
-
106
- ## Additional Information
107
-
108
- - [French Version](./README.fr.md)
109
- - [Patch Notes](./PATCHNOTE.md)
110
-
111
- ## License
112
-
113
- This project is licensed under the MIT License.
1
+ # LogXpert
2
+
3
+ LogXpert is a powerful logging library for Node.js that provides easy-to-use logging methods with colorful formatted output and optional file logging support.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install logxpert
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ CommonJS:
14
+
15
+ ```js
16
+ const log = require('logxpert');
17
+
18
+ log('general message');
19
+ log.error('error message');
20
+ log.warn('warn message');
21
+ log.info('info with meta', { user: 1 });
22
+ log.debug({ structured: 'object' });
23
+ log.error(new Error('boom'));
24
+ ```
25
+
26
+ ESM:
27
+
28
+ ```js
29
+ import log from 'logxpert';
30
+
31
+ log.info('hello');
32
+ ```
33
+
34
+ Set level (`LOG_LEVEL` env also respected):
35
+
36
+ ```js
37
+ log.setLevel('info');
38
+ console.log(log.getLevel());
39
+ ```
40
+
41
+ Isolated instances and child loggers:
42
+
43
+ ```js
44
+ const { createLogger } = require('logxpert');
45
+ const apiLog = createLogger({ level: 'info' });
46
+ apiLog.info('isolated');
47
+
48
+ const child = log.child({ service: 'api' });
49
+ child.info('child message');
50
+ ```
51
+
52
+ ### File output & console timestamp
53
+
54
+ ```js
55
+ log.settings({
56
+ level: 'debug',
57
+ console: {
58
+ enableTimestamp: true,
59
+ timestampFormat: 'YYYY-MM-DD HH:mm:ss',
60
+ timestampPrefix: '',
61
+ timestampSuffix: '',
62
+ colorize: true
63
+ },
64
+ files: {
65
+ folder: 'logs',
66
+ filename: 'application-%DATE%.log',
67
+ filesName: 'YYYY-MM-DD',
68
+ maxFile: '14d',
69
+ maxSize: '20m',
70
+ zippedArchive: false
71
+ }
72
+ });
73
+ ```
74
+
75
+ Close file transports on shutdown:
76
+
77
+ ```js
78
+ log.close();
79
+ ```
80
+
81
+ ## API Reference
82
+
83
+ - **log(message, ...meta):** info level.
84
+ - **log.error/warn/info/debug/http/verbose/silly(message, ...meta)**
85
+ - **log.log(level, message, ...meta)**
86
+ - **log.settings({ console, files, level })**
87
+ - **log.setLevel(level) / log.getLevel()**
88
+ - **log.createLogger(options):** independent instance.
89
+ - **log.child(meta):** child logger with bound context.
90
+ - **log.close():** remove file transport.
91
+
92
+ Console options: `enableTimestamp`, `timestampFormat`, `timestampPrefix`, `timestampSuffix`, `colorize`, `level`.
93
+ Files options: `folder`, `filename`, `filesName`/`datePattern`, `maxFile`/`maxFiles`, `maxSize`, `zippedArchive`, `level`.
94
+
95
+ ## License
96
+
97
+ GPL-3.0-only. See [LICENSE](LICENSE).
package/index.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ export type LogLevel = 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly';
2
+
3
+ export interface ConsoleOptions {
4
+ enableTimestamp?: boolean;
5
+ timestampFormat?: string;
6
+ timestampPrefix?: string;
7
+ timestampSuffix?: string;
8
+ colorize?: boolean;
9
+ level?: LogLevel;
10
+ }
11
+
12
+ export interface FilesOptions {
13
+ folder?: string;
14
+ filesName?: string;
15
+ datePattern?: string;
16
+ filename?: string;
17
+ maxFile?: string;
18
+ maxFiles?: string;
19
+ maxSize?: string;
20
+ zippedArchive?: boolean;
21
+ level?: LogLevel;
22
+ }
23
+
24
+ export interface LogSettingsOptions {
25
+ console?: ConsoleOptions;
26
+ files?: FilesOptions;
27
+ level?: LogLevel;
28
+ }
29
+
30
+ export interface ChildLogger {
31
+ error(message: unknown, ...meta: unknown[]): void;
32
+ warn(message: unknown, ...meta: unknown[]): void;
33
+ info(message: unknown, ...meta: unknown[]): void;
34
+ debug(message: unknown, ...meta: unknown[]): void;
35
+ log(level: LogLevel, message: unknown, ...meta: unknown[]): void;
36
+ }
37
+
38
+ export interface LogXpert {
39
+ (message: unknown, ...meta: unknown[]): void;
40
+ error(message: unknown, ...meta: unknown[]): void;
41
+ warn(message: unknown, ...meta: unknown[]): void;
42
+ info(message: unknown, ...meta: unknown[]): void;
43
+ debug(message: unknown, ...meta: unknown[]): void;
44
+ http(message: unknown, ...meta: unknown[]): void;
45
+ verbose(message: unknown, ...meta: unknown[]): void;
46
+ silly(message: unknown, ...meta: unknown[]): void;
47
+ log(level: LogLevel, message: unknown, ...meta: unknown[]): void;
48
+ settings(options?: LogSettingsOptions): void;
49
+ setLevel(level: LogLevel): void;
50
+ getLevel(): string;
51
+ child(meta?: Record<string, unknown>): ChildLogger;
52
+ close(): void;
53
+ createLogger(options?: LogSettingsOptions): LogXpert;
54
+ }
55
+
56
+ declare const log: LogXpert;
57
+ export default log;
package/main.js CHANGED
@@ -1,185 +1,188 @@
1
- const fs = require('fs');
2
- const moment = require('moment'); // Add moment as a dependency: npm install moment
3
- const { createLogger, format, transports } = require('winston');
4
- require('winston-daily-rotate-file');
5
-
6
- /**
7
- * Helper function to format the timestamp while preserving square brackets.
8
- * It replaces "[" with "%%LB%%" and "]" with "%%RB%%" to prevent Moment.js from
9
- * treating the contents as literal text. After formatting, the placeholders are restored.
10
- *
11
- * @param {string} fmt - The user-defined format string.
12
- * @returns {string} - The formatted timestamp with square brackets preserved.
13
- *
14
- * Example:
15
- * Input: "This is the date: [YYYY-MM-DD HH:mm:ss] - "
16
- * Might output: "This is the date: [2025-03-21 15:30:45] - "
17
- */
18
- function formatCustomTimestamp(fmt) {
19
- // Replace square brackets with temporary placeholders that won't interfere with Moment.js formatting
20
- const temp = fmt.replace(/\[/g, '%%LB%%').replace(/\]/g, '%%RB%%');
21
- // Format the timestamp using Moment.js
22
- const formatted = moment().format(temp);
23
- // Replace the placeholders back with the square brackets
24
- return formatted.replace(/%%LB%%/g, '[').replace(/%%RB%%/g, ']');
25
- }
26
-
27
-
28
- /**
29
- * @typedef {Object} ConsoleOptions
30
- * @property {boolean} [enableTimestamp=true] - Enable or disable timestamp in console logs.
31
- * @property {string} [timestampFormat='YYYY-MM-DD HH:mm:ss'] - Custom format for the timestamp.
32
- * You can include any decoration characters ([], (), {}) without interference.
33
- * For example:
34
- * - "This is the date: [YYYY-MM-DD HH:mm:ss] - "
35
- * - "date: YYYY-MM-DD heure: HH:mm:ss - "
36
- */
37
-
38
- /**
39
- * @typedef {Object} FilesOptions
40
- * @property {string} [folder='logs'] - Directory where log files will be stored.
41
- * @property {string} [filesName='YYYY-MM-DD'] - Date pattern used in the log file name.
42
- * @property {string} [maxFile='14d'] - Maximum file retention time.
43
- * @property {string} [maxSize='20m'] - Maximum file size per log file.
44
- * @property {boolean} [zippedArchive=false] - Whether to archive logs as zip.
45
- */
46
-
47
- /**
48
- * @typedef {Object} LogSettingsOptions
49
- * @property {ConsoleOptions} [console] - Options for customizing console output.
50
- * @property {FilesOptions} [files] - Options for configuring file logging.
51
- */
52
-
53
- // Custom format for logger output
54
- const customFormat = format.printf(({ timestamp, level, message }) => {
55
- return timestamp ? `${timestamp} [${level}]: ${message}` : `[${level}]: ${message}`;
56
- });
57
-
58
- // Default console timestamp format
59
- const defaultConsoleFormat = 'YYYY-MM-DD HH:mm:ss';
60
-
61
- // Create the global logger. Its default format will be overridden by the console transport settings.
62
- const logger = createLogger({
63
- level: 'debug',
64
- format: format.combine(
65
- format.timestamp({ format: () => moment().format(defaultConsoleFormat) }),
66
- customFormat
67
- )
68
- });
69
-
70
- // Create default console transport (will be replaced via settings)
71
- let consoleTransport = new transports.Console({
72
- format: format.combine(
73
- format.colorize(),
74
- format.timestamp({ format: () => moment().format(defaultConsoleFormat) }),
75
- customFormat
76
- )
77
- });
78
- logger.add(consoleTransport);
79
-
80
- // Reference to file transport (added via settings)
81
- let fileTransport;
82
-
83
- /**
84
- * Configures logging settings for both console and file transports.
85
- *
86
- * @param {LogSettingsOptions} options - The settings for both console and file logging.
87
- * @example
88
- * // Example: Fully custom console timestamp that preserves decorational brackets,
89
- * // and enabling file logging.
90
- * log.settings({
91
- * console: {
92
- * enableTimestamp: true,
93
- * timestampFormat: "This is the date: [YYYY-MM-DD HH:mm:ss] - "
94
- * },
95
- * files: {
96
- * folder: 'logs',
97
- * filesName: 'YYYY-MM-DD',
98
- * maxFile: '14d',
99
- * maxSize: '20m',
100
- * zippedArchive: false
101
- * }
102
- * });
103
- */
104
- function applySettings(options = {}) {
105
- if (options.console) {
106
- const enableTimestamp = options.console.enableTimestamp !== undefined ? options.console.enableTimestamp : true;
107
- const timestampFormat = options.console.timestampFormat || defaultConsoleFormat;
108
-
109
- // Remove the current console transport
110
- logger.remove(consoleTransport);
111
-
112
- // Build the console format based on the enableTimestamp flag.
113
- const consoleFormat = enableTimestamp
114
- ? format.combine(
115
- format.colorize(),
116
- format.timestamp({ format: () => formatCustomTimestamp(timestampFormat) }),
117
- customFormat
118
- )
119
- : format.combine(
120
- format((info) => { delete info.timestamp; return info; })(),
121
- format.colorize(),
122
- customFormat
123
- );
124
-
125
- consoleTransport = new transports.Console({
126
- format: consoleFormat
127
- });
128
- logger.add(consoleTransport);
129
- }
130
-
131
- if (options.files) {
132
- const folder = options.files.folder || 'logs';
133
- const datePattern = options.files.filesName || 'YYYY-MM-DD';
134
- const maxFiles = options.files.maxFile || '14d';
135
- const maxSize = options.files.maxSize || '20m';
136
- const zippedArchive = options.files.zippedArchive !== undefined ? options.files.zippedArchive : false;
137
-
138
- if (!fs.existsSync(folder)) {
139
- fs.mkdirSync(folder, { recursive: true });
140
- }
141
-
142
- if (fileTransport) {
143
- logger.remove(fileTransport);
144
- }
145
-
146
- fileTransport = new transports.DailyRotateFile({
147
- filename: `${folder}/application-%DATE%.log`,
148
- datePattern,
149
- zippedArchive,
150
- maxSize,
151
- maxFiles
152
- });
153
- logger.add(fileTransport);
154
- }
155
- }
156
-
157
- /**
158
- * Logs a general message using the info level.
159
- *
160
- * @param {string} message - The message to be logged.
161
- */
162
- function log(message) {
163
- logger.info(message);
164
- }
165
-
166
- log.error = function (message) {
167
- logger.error(message);
168
- };
169
-
170
- log.warn = function (message) {
171
- logger.warn(message);
172
- };
173
-
174
- log.info = function (message) {
175
- logger.info(message);
176
- };
177
-
178
- log.debug = function (message) {
179
- logger.debug(message);
180
- };
181
-
182
- // Expose the settings function for configuring both file logging and console output.
183
- log.settings = applySettings;
184
-
185
- module.exports = log;
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const dayjs = require('dayjs');
4
+ const { createLogger, format, transports } = require('winston');
5
+ require('winston-daily-rotate-file');
6
+
7
+ const VALID_LEVELS = ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'];
8
+ const DEFAULT_CONSOLE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
9
+
10
+ function formatCustomTimestamp(fmt) {
11
+ if (typeof fmt !== 'string' || !fmt) return dayjs().format(DEFAULT_CONSOLE_FORMAT);
12
+ if (fmt.includes('[') && fmt.includes(']')) {
13
+ return fmt.split(/(\[[^\]]*\])/).map((part) => {
14
+ if (part.startsWith('[') && part.endsWith(']')) {
15
+ const inner = part.slice(1, -1);
16
+ return '[' + (inner ? dayjs().format(inner) : '') + ']';
17
+ }
18
+ return part;
19
+ }).join('');
20
+ }
21
+ return dayjs().format(fmt);
22
+ }
23
+
24
+ function formatExtra(meta) {
25
+ const keys = Object.keys(meta).filter((k) => k !== 'splat' && k !== 'ms');
26
+ if (!keys.length) return '';
27
+ try {
28
+ const picked = {};
29
+ for (const k of keys) picked[k] = meta[k];
30
+ return JSON.stringify(picked);
31
+ } catch {
32
+ return '';
33
+ }
34
+ }
35
+
36
+ const prettyFormat = format.printf(({ timestamp, level, message, ...meta }) => {
37
+ const msg = typeof message === 'string' ? message : message == null ? '' : JSON.stringify(message);
38
+ const extra = formatExtra(meta);
39
+ const body = [msg, extra].filter(Boolean).join(' ');
40
+ return timestamp ? `${timestamp} [${level}]: ${body}` : `[${level}]: ${body}`;
41
+ });
42
+
43
+ function assertLevel(level) {
44
+ if (!VALID_LEVELS.includes(level)) throw new Error(`Invalid log level "${level}". Use one of: ${VALID_LEVELS.join(', ')}`);
45
+ }
46
+
47
+ function normalizeFilesOptions(files = {}) {
48
+ const folder = files.folder ?? 'logs';
49
+ if (typeof folder !== 'string' || !folder.trim() || folder.includes('\0')) {
50
+ throw new Error('files.folder must be a non-empty string');
51
+ }
52
+ const datePattern = files.filesName ?? files.datePattern ?? 'YYYY-MM-DD';
53
+ if (typeof datePattern !== 'string' || !datePattern.trim()) {
54
+ throw new Error('files.filesName/datePattern must be a non-empty string');
55
+ }
56
+ let filename = files.filename ?? `application-%DATE%.log`;
57
+ if (typeof filename !== 'string' || !filename.trim()) {
58
+ throw new Error('files.filename must be a non-empty string');
59
+ }
60
+ if (!filename.includes('%DATE%')) {
61
+ const ext = path.extname(filename) || '.log';
62
+ const base = path.basename(filename, ext);
63
+ filename = `${base}-%DATE%${ext}`;
64
+ }
65
+ return {
66
+ folder: path.normalize(folder),
67
+ datePattern,
68
+ filename,
69
+ maxFiles: files.maxFile ?? files.maxFiles ?? '14d',
70
+ maxSize: files.maxSize ?? '20m',
71
+ zippedArchive: files.zippedArchive ?? false,
72
+ level: files.level,
73
+ };
74
+ }
75
+
76
+ function buildConsoleTransport({ enableTimestamp = true, timestampFormat = DEFAULT_CONSOLE_FORMAT, timestampPrefix = '', timestampSuffix = '', colorize = true, level } = {}) {
77
+ const parts = [];
78
+ if (colorize) parts.push(format.colorize());
79
+ if (enableTimestamp) {
80
+ parts.push(format.timestamp({ format: () => `${timestampPrefix}${formatCustomTimestamp(timestampFormat)}${timestampSuffix}` }));
81
+ } else {
82
+ parts.push(format((info) => { delete info.timestamp; return info; })());
83
+ }
84
+ parts.push(format.errors({ stack: true }), format.splat(), prettyFormat);
85
+ return new transports.Console({ format: format.combine(...parts), level });
86
+ }
87
+
88
+ function buildFileTransport({ folder, datePattern, filename, maxFiles, maxSize, zippedArchive, level }) {
89
+ if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true });
90
+ return new transports.DailyRotateFile({
91
+ filename: path.join(folder, filename),
92
+ datePattern,
93
+ zippedArchive,
94
+ maxSize,
95
+ maxFiles,
96
+ level,
97
+ format: format.combine(format.errors({ stack: true }), format.splat(), format.timestamp(), prettyFormat),
98
+ });
99
+ }
100
+
101
+ function createLoggerInstance(initial = {}) {
102
+ const globalLevel = process.env.LOG_LEVEL || initial.level || 'debug';
103
+ assertLevel(globalLevel);
104
+
105
+ const logger = createLogger({
106
+ level: globalLevel,
107
+ format: format.combine(format.errors({ stack: true }), format.splat()),
108
+ });
109
+
110
+ let consoleTransport = buildConsoleTransport(initial.console);
111
+ consoleTransport.level = initial.console?.level;
112
+ logger.add(consoleTransport);
113
+
114
+ let fileTransport = null;
115
+ let consoleOpts = { ...(initial.console || {}) };
116
+ let filesOpts = null;
117
+
118
+ function applySettings(options = {}) {
119
+ if (options.level !== undefined) {
120
+ assertLevel(options.level);
121
+ logger.level = options.level;
122
+ }
123
+ if (options.console) {
124
+ if (options.console.level !== undefined && options.console.level !== null) assertLevel(options.console.level);
125
+ consoleOpts = { ...consoleOpts, ...options.console };
126
+ logger.remove(consoleTransport);
127
+ consoleTransport = buildConsoleTransport(consoleOpts);
128
+ consoleTransport.level = consoleOpts.level;
129
+ logger.add(consoleTransport);
130
+ }
131
+ if (options.files) {
132
+ const normalized = normalizeFilesOptions(options.files);
133
+ if (normalized.level !== undefined && normalized.level !== null) assertLevel(normalized.level);
134
+ filesOpts = normalized;
135
+ if (fileTransport) logger.remove(fileTransport);
136
+ fileTransport = buildFileTransport(normalized);
137
+ logger.add(fileTransport);
138
+ }
139
+ }
140
+
141
+ function write(level, message, ...meta) {
142
+ if (message instanceof Error) {
143
+ logger.log(level, message.message, { stack: message.stack, ...meta[0] });
144
+ return;
145
+ }
146
+ logger.log(level, message, ...meta);
147
+ }
148
+
149
+ function callable(message, ...meta) {
150
+ write('info', message, ...meta);
151
+ }
152
+
153
+ callable.error = (m, ...a) => write('error', m, ...a);
154
+ callable.warn = (m, ...a) => write('warn', m, ...a);
155
+ callable.info = (m, ...a) => write('info', m, ...a);
156
+ callable.debug = (m, ...a) => write('debug', m, ...a);
157
+ callable.http = (m, ...a) => write('http', m, ...a);
158
+ callable.verbose = (m, ...a) => write('verbose', m, ...a);
159
+ callable.silly = (m, ...a) => write('silly', m, ...a);
160
+ callable.log = (level, m, ...a) => { assertLevel(level); write(level, m, ...a); };
161
+
162
+ callable.settings = applySettings;
163
+ callable.setLevel = (level) => { assertLevel(level); logger.level = level; };
164
+ callable.getLevel = () => logger.level;
165
+ callable.child = (meta = {}) => {
166
+ const child = logger.child(meta);
167
+ return {
168
+ error: (m, ...a) => child.error(m, ...a),
169
+ warn: (m, ...a) => child.warn(m, ...a),
170
+ info: (m, ...a) => child.info(m, ...a),
171
+ debug: (m, ...a) => child.debug(m, ...a),
172
+ log: child.log.bind(child),
173
+ };
174
+ };
175
+ callable.close = () => {
176
+ if (fileTransport) { logger.remove(fileTransport); try { fileTransport.close?.(); } catch {} fileTransport = null; }
177
+ };
178
+ callable.createLogger = (opts = {}) => createLoggerInstance(opts);
179
+ callable._winston = logger;
180
+
181
+ if (initial.files) applySettings({ files: initial.files });
182
+ if (initial.console || initial.level) applySettings({ console: initial.console, level: initial.level });
183
+
184
+ return callable;
185
+ }
186
+
187
+ module.exports = createLoggerInstance();
188
+ module.exports.createLogger = createLoggerInstance;