jet-logger 2.2.1 → 2.2.3

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.
@@ -1,82 +1,78 @@
1
1
  import colors from 'colors';
2
2
  import fs from 'fs';
3
3
  import util from 'util';
4
- const LOGGER_MODES = {
5
- Console: 'CONSOLE',
6
- File: 'FILE',
7
- Custom: 'CUSTOM',
8
- Off: 'OFF',
4
+ const Modes = {
5
+ CONSOLE: 'console',
6
+ FILE: 'file',
7
+ CUSTOM: 'custom',
8
+ OFF: 'off',
9
9
  };
10
- const FORMATS = {
11
- Line: 'LINE',
12
- Json: 'JSON',
10
+ const Formats = {
11
+ LINE: 'line',
12
+ JSON: 'json',
13
13
  };
14
- const LEVELS = {
14
+ const Levels = {
15
15
  Info: {
16
- Color: 'green',
17
- Prefix: 'INFO',
16
+ COLOR: 'green',
17
+ PREFIX: 'INFO',
18
18
  },
19
19
  Important: {
20
- Color: 'magenta',
21
- Prefix: 'IMPORTANT',
20
+ COLOR: 'magenta',
21
+ PREFIX: 'IMPORTANT',
22
22
  },
23
23
  Warning: {
24
- Color: 'yellow',
25
- Prefix: 'WARNING',
24
+ COLOR: 'yellow',
25
+ PREFIX: 'WARNING',
26
26
  },
27
27
  Error: {
28
- Color: 'red',
29
- Prefix: 'ERROR',
28
+ COLOR: 'red',
29
+ PREFIX: 'ERROR',
30
30
  },
31
31
  };
32
- const DEFAULTS = {
33
- mode: LOGGER_MODES.Console,
34
- filePath: 'jet-logger.log',
35
- timestamp: true,
36
- format: FORMATS.Line,
37
- customLogFn: () => ({}),
32
+ const Defaults = {
33
+ MODE: Modes.CONSOLE,
34
+ FILE_PATH: 'jet-logger.log',
35
+ TIMESTAMP: true,
36
+ FORMAT: Formats.LINE,
37
+ CUSTOM_LOGGER_FUNCTION: () => ({}),
38
38
  };
39
39
  const Errors = {
40
- CustomLogger: 'Custom logger mode set to true, but no custom logger was provided.',
41
- Mode: 'The correct logger mode was not specified: Must be "CUSTOM", "FILE", ' +
42
- '"OFF", or "CONSOLE".',
40
+ CUSTOM_LOGGER: 'Custom logger mode set to true, but no custom logger was provided.',
41
+ MODE: 'The correct logger mode was not specified: Must be "custom", "file", ' +
42
+ '"off", or "console".',
43
43
  };
44
44
  export const JetLogger = {
45
- Modes: LOGGER_MODES,
46
- Formats: FORMATS,
47
- instanceOf,
45
+ Modes,
46
+ Formats,
48
47
  };
49
- const kJetLogger = Symbol('k-jet-logger');
50
48
  export function jetLogger(options) {
51
- let mode = DEFAULTS.mode, filePath = DEFAULTS.filePath, timestamp = DEFAULTS.timestamp, format = DEFAULTS.format, customLogFn = DEFAULTS.customLogFn;
49
+ let mode = Defaults.MODE, filePath = Defaults.FILE_PATH, timestamp = Defaults.TIMESTAMP, format = Defaults.FORMAT, customLogFn = Defaults.CUSTOM_LOGGER_FUNCTION;
52
50
  if (options?.mode !== undefined) {
53
51
  mode = options.mode;
54
52
  }
55
53
  else if (!!process.env.JET_LOGGER_MODE) {
56
- mode = process.env.JET_LOGGER_MODE.toUpperCase();
54
+ mode = process.env.JET_LOGGER_MODE.toLowerCase();
57
55
  }
58
- if (mode === LOGGER_MODES.Off) {
56
+ if (mode === Modes.OFF) {
59
57
  return {
60
58
  info: (_, __) => ({}),
61
59
  imp: (_, __) => ({}),
62
60
  warn: (_, __) => ({}),
63
61
  err: (_, __) => ({}),
64
- [kJetLogger]: true,
65
62
  };
66
63
  }
67
- if (mode === LOGGER_MODES.Custom) {
64
+ if (mode === Modes.CUSTOM) {
68
65
  if (options?.customLogger !== undefined) {
69
66
  customLogFn = options.customLogger;
70
67
  }
71
68
  if (!customLogFn) {
72
- throw Error(Errors.CustomLogger);
69
+ throw Error(Errors.CUSTOM_LOGGER);
73
70
  }
74
71
  return {
75
- info: setupPrintWithCustomLogger(LEVELS.Info, customLogFn),
76
- imp: setupPrintWithCustomLogger(LEVELS.Important, customLogFn),
77
- warn: setupPrintWithCustomLogger(LEVELS.Warning, customLogFn),
78
- err: setupPrintWithCustomLogger(LEVELS.Error, customLogFn),
79
- [kJetLogger]: true,
72
+ info: setupPrintWithCustomLogger(Levels.Info, customLogFn),
73
+ imp: setupPrintWithCustomLogger(Levels.Important, customLogFn),
74
+ warn: setupPrintWithCustomLogger(Levels.Warning, customLogFn),
75
+ err: setupPrintWithCustomLogger(Levels.Error, customLogFn),
80
76
  };
81
77
  }
82
78
  if (options?.filepath !== undefined) {
@@ -90,47 +86,45 @@ export function jetLogger(options) {
90
86
  }
91
87
  else if (!!process.env.JET_LOGGER_TIMESTAMP) {
92
88
  const envVar = process.env.JET_LOGGER_TIMESTAMP;
93
- timestamp = envVar.toUpperCase() === 'TRUE';
89
+ timestamp = envVar.toLowerCase() === 'true';
94
90
  }
95
91
  if (options?.format !== undefined) {
96
92
  format = options.format;
97
93
  }
98
94
  else if (!!process.env.JET_LOGGER_FORMAT) {
99
- format = process.env.JET_LOGGER_FORMAT.toUpperCase();
95
+ format = process.env.JET_LOGGER_FORMAT.toLowerCase();
100
96
  }
101
97
  let formatter = () => '';
102
- if (format === FORMATS.Line) {
98
+ if (format === Formats.LINE) {
103
99
  formatter = setupLineFormatter(timestamp);
104
100
  }
105
- else if (format === FORMATS.Json) {
101
+ else if (format === Formats.JSON) {
106
102
  formatter = setupJsonFormatter(timestamp);
107
103
  }
108
- if (mode === LOGGER_MODES.File) {
104
+ if (mode === Modes.FILE) {
109
105
  let filePathDatetime = true;
110
106
  if (options?.filepathDatetimeParam !== undefined) {
111
107
  filePathDatetime = options.filepathDatetimeParam;
112
108
  }
113
109
  else if (!!process.env.JET_LOGGER_FILEPATH_DATETIME) {
114
110
  const envVar = process.env.JET_LOGGER_FILEPATH_DATETIME;
115
- filePathDatetime = envVar.toUpperCase() === 'TRUE';
111
+ filePathDatetime = envVar.toLowerCase() === 'true';
116
112
  }
117
113
  if (filePathDatetime) {
118
114
  filePath = addDatetimeToFileName(filePath);
119
115
  }
120
116
  return {
121
- info: setupPrintToFile(LEVELS.Info, formatter, filePath),
122
- imp: setupPrintToFile(LEVELS.Important, formatter, filePath),
123
- warn: setupPrintToFile(LEVELS.Warning, formatter, filePath),
124
- err: setupPrintToFile(LEVELS.Error, formatter, filePath),
125
- [kJetLogger]: true,
117
+ info: setupPrintToFile(Levels.Info, formatter, filePath),
118
+ imp: setupPrintToFile(Levels.Important, formatter, filePath),
119
+ warn: setupPrintToFile(Levels.Warning, formatter, filePath),
120
+ err: setupPrintToFile(Levels.Error, formatter, filePath),
126
121
  };
127
122
  }
128
123
  return {
129
- info: setupPrintToConsole(LEVELS.Info, formatter),
130
- imp: setupPrintToConsole(LEVELS.Important, formatter),
131
- warn: setupPrintToConsole(LEVELS.Warning, formatter),
132
- err: setupPrintToConsole(LEVELS.Error, formatter),
133
- [kJetLogger]: true,
124
+ info: setupPrintToConsole(Levels.Info, formatter),
125
+ imp: setupPrintToConsole(Levels.Important, formatter),
126
+ warn: setupPrintToConsole(Levels.Warning, formatter),
127
+ err: setupPrintToConsole(Levels.Error, formatter),
134
128
  };
135
129
  }
136
130
  function setupPrintWithCustomLogger(level, customLogFn) {
@@ -142,19 +136,19 @@ function setupPrintWithCustomLogger(level, customLogFn) {
142
136
  else {
143
137
  contentNew = String(content);
144
138
  }
145
- return customLogFn(new Date(), level.Prefix, contentNew);
139
+ return customLogFn(new Date(), level.PREFIX, contentNew);
146
140
  };
147
141
  }
148
142
  function setupLineFormatter(timestamp) {
149
143
  if (timestamp) {
150
144
  return (content, level) => {
151
- const contentNew = level.Prefix + ': ' + content, time = '[' + new Date().toISOString() + '] ';
145
+ const contentNew = level.PREFIX + ': ' + content, time = '[' + new Date().toISOString() + '] ';
152
146
  return time + contentNew;
153
147
  };
154
148
  }
155
149
  else {
156
150
  return (content, level) => {
157
- return level.Prefix + ': ' + content;
151
+ return level.PREFIX + ': ' + content;
158
152
  };
159
153
  }
160
154
  }
@@ -162,7 +156,7 @@ function setupJsonFormatter(timestamp) {
162
156
  if (timestamp) {
163
157
  return (content, level) => {
164
158
  const json = {
165
- level: level.Prefix,
159
+ level: level.PREFIX,
166
160
  message: content,
167
161
  };
168
162
  json.timestamp = new Date().toISOString();
@@ -172,7 +166,7 @@ function setupJsonFormatter(timestamp) {
172
166
  else {
173
167
  return (content, level) => {
174
168
  const json = {
175
- level: level.Prefix,
169
+ level: level.PREFIX,
176
170
  message: content,
177
171
  };
178
172
  return JSON.stringify(json);
@@ -189,7 +183,7 @@ function setupPrintToFile(level, formatter, filePath) {
189
183
  contentNew = String(content);
190
184
  }
191
185
  contentNew = formatter(contentNew, level);
192
- fs.appendFile(filePath, contentNew, (err) => {
186
+ fs.appendFile(filePath, contentNew + '\n', (err) => {
193
187
  if (!!err) {
194
188
  console.error(err);
195
189
  }
@@ -205,7 +199,7 @@ function setupPrintToConsole(level, formatter) {
205
199
  else {
206
200
  contentNew = String(content);
207
201
  }
208
- const colorFn = colors[level.Color];
202
+ const colorFn = colors[level.COLOR];
209
203
  contentNew = formatter(contentNew, level);
210
204
  console.log(colorFn(contentNew));
211
205
  };
@@ -222,8 +216,4 @@ function addDatetimeToFileName(filePath) {
222
216
  filePathArr[lastIdx] = fileNameNew;
223
217
  return filePathArr.join('/');
224
218
  }
225
- function instanceOf(arg) {
226
- return (typeof arg === 'object' &&
227
- arg[kJetLogger] === true);
228
- }
229
219
  export default jetLogger();
@@ -1,82 +1,78 @@
1
1
  import colors from 'colors';
2
2
  import fs from 'fs';
3
3
  import util from 'util';
4
- const LOGGER_MODES = {
5
- Console: 'CONSOLE',
6
- File: 'FILE',
7
- Custom: 'CUSTOM',
8
- Off: 'OFF',
4
+ const Modes = {
5
+ CONSOLE: 'console',
6
+ FILE: 'file',
7
+ CUSTOM: 'custom',
8
+ OFF: 'off',
9
9
  };
10
- const FORMATS = {
11
- Line: 'LINE',
12
- Json: 'JSON',
10
+ const Formats = {
11
+ LINE: 'line',
12
+ JSON: 'json',
13
13
  };
14
- const LEVELS = {
14
+ const Levels = {
15
15
  Info: {
16
- Color: 'green',
17
- Prefix: 'INFO',
16
+ COLOR: 'green',
17
+ PREFIX: 'INFO',
18
18
  },
19
19
  Important: {
20
- Color: 'magenta',
21
- Prefix: 'IMPORTANT',
20
+ COLOR: 'magenta',
21
+ PREFIX: 'IMPORTANT',
22
22
  },
23
23
  Warning: {
24
- Color: 'yellow',
25
- Prefix: 'WARNING',
24
+ COLOR: 'yellow',
25
+ PREFIX: 'WARNING',
26
26
  },
27
27
  Error: {
28
- Color: 'red',
29
- Prefix: 'ERROR',
28
+ COLOR: 'red',
29
+ PREFIX: 'ERROR',
30
30
  },
31
31
  };
32
- const DEFAULTS = {
33
- mode: LOGGER_MODES.Console,
34
- filePath: 'jet-logger.log',
35
- timestamp: true,
36
- format: FORMATS.Line,
37
- customLogFn: () => ({}),
32
+ const Defaults = {
33
+ MODE: Modes.CONSOLE,
34
+ FILE_PATH: 'jet-logger.log',
35
+ TIMESTAMP: true,
36
+ FORMAT: Formats.LINE,
37
+ CUSTOM_LOGGER_FUNCTION: () => ({}),
38
38
  };
39
39
  const Errors = {
40
- CustomLogger: 'Custom logger mode set to true, but no custom logger was provided.',
41
- Mode: 'The correct logger mode was not specified: Must be "CUSTOM", "FILE", ' +
42
- '"OFF", or "CONSOLE".',
40
+ CUSTOM_LOGGER: 'Custom logger mode set to true, but no custom logger was provided.',
41
+ MODE: 'The correct logger mode was not specified: Must be "custom", "file", ' +
42
+ '"off", or "console".',
43
43
  };
44
44
  export const JetLogger = {
45
- Modes: LOGGER_MODES,
46
- Formats: FORMATS,
47
- instanceOf,
45
+ Modes,
46
+ Formats,
48
47
  };
49
- const kJetLogger = Symbol('k-jet-logger');
50
48
  export function jetLogger(options) {
51
- let mode = DEFAULTS.mode, filePath = DEFAULTS.filePath, timestamp = DEFAULTS.timestamp, format = DEFAULTS.format, customLogFn = DEFAULTS.customLogFn;
49
+ let mode = Defaults.MODE, filePath = Defaults.FILE_PATH, timestamp = Defaults.TIMESTAMP, format = Defaults.FORMAT, customLogFn = Defaults.CUSTOM_LOGGER_FUNCTION;
52
50
  if (options?.mode !== undefined) {
53
51
  mode = options.mode;
54
52
  }
55
53
  else if (!!process.env.JET_LOGGER_MODE) {
56
- mode = process.env.JET_LOGGER_MODE.toUpperCase();
54
+ mode = process.env.JET_LOGGER_MODE.toLowerCase();
57
55
  }
58
- if (mode === LOGGER_MODES.Off) {
56
+ if (mode === Modes.OFF) {
59
57
  return {
60
58
  info: (_, __) => ({}),
61
59
  imp: (_, __) => ({}),
62
60
  warn: (_, __) => ({}),
63
61
  err: (_, __) => ({}),
64
- [kJetLogger]: true,
65
62
  };
66
63
  }
67
- if (mode === LOGGER_MODES.Custom) {
64
+ if (mode === Modes.CUSTOM) {
68
65
  if (options?.customLogger !== undefined) {
69
66
  customLogFn = options.customLogger;
70
67
  }
71
68
  if (!customLogFn) {
72
- throw Error(Errors.CustomLogger);
69
+ throw Error(Errors.CUSTOM_LOGGER);
73
70
  }
74
71
  return {
75
- info: setupPrintWithCustomLogger(LEVELS.Info, customLogFn),
76
- imp: setupPrintWithCustomLogger(LEVELS.Important, customLogFn),
77
- warn: setupPrintWithCustomLogger(LEVELS.Warning, customLogFn),
78
- err: setupPrintWithCustomLogger(LEVELS.Error, customLogFn),
79
- [kJetLogger]: true,
72
+ info: setupPrintWithCustomLogger(Levels.Info, customLogFn),
73
+ imp: setupPrintWithCustomLogger(Levels.Important, customLogFn),
74
+ warn: setupPrintWithCustomLogger(Levels.Warning, customLogFn),
75
+ err: setupPrintWithCustomLogger(Levels.Error, customLogFn),
80
76
  };
81
77
  }
82
78
  if (options?.filepath !== undefined) {
@@ -90,47 +86,45 @@ export function jetLogger(options) {
90
86
  }
91
87
  else if (!!process.env.JET_LOGGER_TIMESTAMP) {
92
88
  const envVar = process.env.JET_LOGGER_TIMESTAMP;
93
- timestamp = envVar.toUpperCase() === 'TRUE';
89
+ timestamp = envVar.toLowerCase() === 'true';
94
90
  }
95
91
  if (options?.format !== undefined) {
96
92
  format = options.format;
97
93
  }
98
94
  else if (!!process.env.JET_LOGGER_FORMAT) {
99
- format = process.env.JET_LOGGER_FORMAT.toUpperCase();
95
+ format = process.env.JET_LOGGER_FORMAT.toLowerCase();
100
96
  }
101
97
  let formatter = () => '';
102
- if (format === FORMATS.Line) {
98
+ if (format === Formats.LINE) {
103
99
  formatter = setupLineFormatter(timestamp);
104
100
  }
105
- else if (format === FORMATS.Json) {
101
+ else if (format === Formats.JSON) {
106
102
  formatter = setupJsonFormatter(timestamp);
107
103
  }
108
- if (mode === LOGGER_MODES.File) {
104
+ if (mode === Modes.FILE) {
109
105
  let filePathDatetime = true;
110
106
  if (options?.filepathDatetimeParam !== undefined) {
111
107
  filePathDatetime = options.filepathDatetimeParam;
112
108
  }
113
109
  else if (!!process.env.JET_LOGGER_FILEPATH_DATETIME) {
114
110
  const envVar = process.env.JET_LOGGER_FILEPATH_DATETIME;
115
- filePathDatetime = envVar.toUpperCase() === 'TRUE';
111
+ filePathDatetime = envVar.toLowerCase() === 'true';
116
112
  }
117
113
  if (filePathDatetime) {
118
114
  filePath = addDatetimeToFileName(filePath);
119
115
  }
120
116
  return {
121
- info: setupPrintToFile(LEVELS.Info, formatter, filePath),
122
- imp: setupPrintToFile(LEVELS.Important, formatter, filePath),
123
- warn: setupPrintToFile(LEVELS.Warning, formatter, filePath),
124
- err: setupPrintToFile(LEVELS.Error, formatter, filePath),
125
- [kJetLogger]: true,
117
+ info: setupPrintToFile(Levels.Info, formatter, filePath),
118
+ imp: setupPrintToFile(Levels.Important, formatter, filePath),
119
+ warn: setupPrintToFile(Levels.Warning, formatter, filePath),
120
+ err: setupPrintToFile(Levels.Error, formatter, filePath),
126
121
  };
127
122
  }
128
123
  return {
129
- info: setupPrintToConsole(LEVELS.Info, formatter),
130
- imp: setupPrintToConsole(LEVELS.Important, formatter),
131
- warn: setupPrintToConsole(LEVELS.Warning, formatter),
132
- err: setupPrintToConsole(LEVELS.Error, formatter),
133
- [kJetLogger]: true,
124
+ info: setupPrintToConsole(Levels.Info, formatter),
125
+ imp: setupPrintToConsole(Levels.Important, formatter),
126
+ warn: setupPrintToConsole(Levels.Warning, formatter),
127
+ err: setupPrintToConsole(Levels.Error, formatter),
134
128
  };
135
129
  }
136
130
  function setupPrintWithCustomLogger(level, customLogFn) {
@@ -142,19 +136,19 @@ function setupPrintWithCustomLogger(level, customLogFn) {
142
136
  else {
143
137
  contentNew = String(content);
144
138
  }
145
- return customLogFn(new Date(), level.Prefix, contentNew);
139
+ return customLogFn(new Date(), level.PREFIX, contentNew);
146
140
  };
147
141
  }
148
142
  function setupLineFormatter(timestamp) {
149
143
  if (timestamp) {
150
144
  return (content, level) => {
151
- const contentNew = level.Prefix + ': ' + content, time = '[' + new Date().toISOString() + '] ';
145
+ const contentNew = level.PREFIX + ': ' + content, time = '[' + new Date().toISOString() + '] ';
152
146
  return time + contentNew;
153
147
  };
154
148
  }
155
149
  else {
156
150
  return (content, level) => {
157
- return level.Prefix + ': ' + content;
151
+ return level.PREFIX + ': ' + content;
158
152
  };
159
153
  }
160
154
  }
@@ -162,7 +156,7 @@ function setupJsonFormatter(timestamp) {
162
156
  if (timestamp) {
163
157
  return (content, level) => {
164
158
  const json = {
165
- level: level.Prefix,
159
+ level: level.PREFIX,
166
160
  message: content,
167
161
  };
168
162
  json.timestamp = new Date().toISOString();
@@ -172,7 +166,7 @@ function setupJsonFormatter(timestamp) {
172
166
  else {
173
167
  return (content, level) => {
174
168
  const json = {
175
- level: level.Prefix,
169
+ level: level.PREFIX,
176
170
  message: content,
177
171
  };
178
172
  return JSON.stringify(json);
@@ -189,7 +183,7 @@ function setupPrintToFile(level, formatter, filePath) {
189
183
  contentNew = String(content);
190
184
  }
191
185
  contentNew = formatter(contentNew, level);
192
- fs.appendFile(filePath, contentNew, (err) => {
186
+ fs.appendFile(filePath, contentNew + '\n', (err) => {
193
187
  if (!!err) {
194
188
  console.error(err);
195
189
  }
@@ -205,7 +199,7 @@ function setupPrintToConsole(level, formatter) {
205
199
  else {
206
200
  contentNew = String(content);
207
201
  }
208
- const colorFn = colors[level.Color];
202
+ const colorFn = colors[level.COLOR];
209
203
  contentNew = formatter(contentNew, level);
210
204
  console.log(colorFn(contentNew));
211
205
  };
@@ -222,8 +216,4 @@ function addDatetimeToFileName(filePath) {
222
216
  filePathArr[lastIdx] = fileNameNew;
223
217
  return filePathArr.join('/');
224
218
  }
225
- function instanceOf(arg) {
226
- return (typeof arg === 'object' &&
227
- arg[kJetLogger] === true);
228
- }
229
219
  export default jetLogger();
@@ -1,51 +1,43 @@
1
1
  /******************************************************************************
2
2
  Constants
3
3
  ******************************************************************************/
4
- declare const LOGGER_MODES: {
5
- readonly Console: "CONSOLE";
6
- readonly File: "FILE";
7
- readonly Custom: "CUSTOM";
8
- readonly Off: "OFF";
4
+ declare const Modes: {
5
+ readonly CONSOLE: "console";
6
+ readonly FILE: "file";
7
+ readonly CUSTOM: "custom";
8
+ readonly OFF: "off";
9
9
  };
10
- declare const FORMATS: {
11
- readonly Line: "LINE";
12
- readonly Json: "JSON";
10
+ declare const Formats: {
11
+ readonly LINE: "line";
12
+ readonly JSON: "json";
13
13
  };
14
14
  export declare const JetLogger: {
15
15
  readonly Modes: {
16
- readonly Console: "CONSOLE";
17
- readonly File: "FILE";
18
- readonly Custom: "CUSTOM";
19
- readonly Off: "OFF";
16
+ readonly CONSOLE: "console";
17
+ readonly FILE: "file";
18
+ readonly CUSTOM: "custom";
19
+ readonly OFF: "off";
20
20
  };
21
21
  readonly Formats: {
22
- readonly Line: "LINE";
23
- readonly Json: "JSON";
22
+ readonly LINE: "line";
23
+ readonly JSON: "json";
24
24
  };
25
- readonly instanceOf: typeof instanceOf;
26
25
  };
27
- declare const kJetLogger: unique symbol;
28
26
  /******************************************************************************
29
27
  Types
30
28
  ******************************************************************************/
31
- type LoggerModes = (typeof LOGGER_MODES)[keyof typeof LOGGER_MODES];
32
- type Formats = (typeof FORMATS)[keyof typeof FORMATS];
29
+ type Modes = (typeof Modes)[keyof typeof Modes];
30
+ type Formats = (typeof Formats)[keyof typeof Formats];
33
31
  type LogFunction = (content: unknown, printFull?: boolean) => void;
34
32
  export type CustomLogger = (timestamp: Date, prefix: string, content: unknown) => void;
35
33
  interface Options {
36
- mode?: LoggerModes;
34
+ mode?: Modes;
37
35
  filepath?: string;
38
36
  filepathDatetimeParam?: boolean;
39
37
  timestamp?: boolean;
40
38
  format?: Formats;
41
39
  customLogger?: CustomLogger;
42
40
  }
43
- interface JetLogger {
44
- info: (content: unknown, print?: boolean) => void;
45
- imp: (content: unknown, print?: boolean) => void;
46
- warn: (content: unknown, print?: boolean) => void;
47
- err: (content: unknown, print?: boolean) => void;
48
- }
49
41
  /******************************************************************************
50
42
  Functions
51
43
  ******************************************************************************/
@@ -57,12 +49,7 @@ export declare function jetLogger(options?: Options): {
57
49
  readonly imp: LogFunction;
58
50
  readonly warn: LogFunction;
59
51
  readonly err: LogFunction;
60
- readonly [kJetLogger]: true;
61
52
  };
62
- /**
63
- * Check if an object is an instance of jetLogger
64
- */
65
- declare function instanceOf(arg: unknown): arg is JetLogger;
66
53
  /******************************************************************************
67
54
  Export
68
55
  ******************************************************************************/
@@ -71,6 +58,5 @@ declare const _default: {
71
58
  readonly imp: LogFunction;
72
59
  readonly warn: LogFunction;
73
60
  readonly err: LogFunction;
74
- readonly [kJetLogger]: true;
75
61
  };
76
62
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jet-logger",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "A super quick, easy to setup logging tool for NodeJS/TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",