jet-logger 1.1.1 → 1.1.2

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/lib/index.d.ts CHANGED
@@ -26,40 +26,40 @@ declare const levels: {
26
26
  prefix: string;
27
27
  };
28
28
  };
29
- declare const _default: Readonly<{
30
- settings: {
31
- mode: LoggerModes;
32
- filePath: string;
33
- timestamp: boolean;
34
- format: Formats;
35
- customLogger: TCustomLogger | undefined;
29
+ declare const _default: {
30
+ readonly settings: {
31
+ readonly mode: LoggerModes;
32
+ readonly filePath: string;
33
+ readonly timestamp: boolean;
34
+ readonly format: Formats;
35
+ readonly customLogger: TCustomLogger | undefined;
36
36
  };
37
- info: typeof info;
38
- imp: typeof imp;
39
- warn: typeof warn;
40
- err: typeof err;
41
- printLogHelper: typeof printLogHelper;
42
- }>;
37
+ readonly info: typeof info;
38
+ readonly imp: typeof imp;
39
+ readonly warn: typeof warn;
40
+ readonly err: typeof err;
41
+ readonly printLog: typeof printLog;
42
+ };
43
43
  export default _default;
44
44
  declare type TLevelProp = typeof levels[keyof typeof levels];
45
45
  declare type TJetLogger = ReturnType<typeof JetLogger>;
46
46
  export declare type TCustomLogger = (timestamp: Date, prefix: string, content: any) => void;
47
- export declare function JetLogger(mode?: LoggerModes, filePath?: string, timestamp?: boolean, format?: Formats, customLogger?: TCustomLogger): Readonly<{
48
- settings: {
49
- mode: LoggerModes;
50
- filePath: string;
51
- timestamp: boolean;
52
- format: Formats;
53
- customLogger: TCustomLogger | undefined;
47
+ export declare function JetLogger(mode?: LoggerModes, filePath?: string, timestamp?: boolean, format?: Formats, customLogger?: TCustomLogger): {
48
+ readonly settings: {
49
+ readonly mode: LoggerModes;
50
+ readonly filePath: string;
51
+ readonly timestamp: boolean;
52
+ readonly format: Formats;
53
+ readonly customLogger: TCustomLogger | undefined;
54
54
  };
55
- info: typeof info;
56
- imp: typeof imp;
57
- warn: typeof warn;
58
- err: typeof err;
59
- printLogHelper: typeof printLogHelper;
60
- }>;
55
+ readonly info: typeof info;
56
+ readonly imp: typeof imp;
57
+ readonly warn: typeof warn;
58
+ readonly err: typeof err;
59
+ readonly printLog: typeof printLog;
60
+ };
61
61
  declare function info(this: TJetLogger, content: any, printFull?: boolean): void;
62
62
  declare function imp(this: TJetLogger, content: any, printFull?: boolean): void;
63
63
  declare function warn(this: TJetLogger, content: any, printFull?: boolean): void;
64
64
  declare function err(this: TJetLogger, content: any, printFull?: boolean): void;
65
- declare function printLogHelper(this: TJetLogger, content: any, printFull: boolean, level: TLevelProp): void;
65
+ declare function printLog(this: TJetLogger, content: any, printFull: boolean, level: TLevelProp): void;
package/lib/index.js CHANGED
@@ -50,14 +50,14 @@ var defaults = {
50
50
  };
51
51
  exports.default = JetLogger();
52
52
  function JetLogger(mode, filePath, timestamp, format, customLogger) {
53
- return Object.freeze({
53
+ return {
54
54
  settings: getSettings(mode, filePath, timestamp, format, customLogger),
55
55
  info: info,
56
56
  imp: imp,
57
57
  warn: warn,
58
58
  err: err,
59
- printLogHelper: printLogHelper,
60
- });
59
+ printLog: printLog,
60
+ };
61
61
  }
62
62
  exports.JetLogger = JetLogger;
63
63
  function getSettings(mode, filePath, timestamp, format, customLogger) {
@@ -102,21 +102,19 @@ function getSettings(mode, filePath, timestamp, format, customLogger) {
102
102
  };
103
103
  }
104
104
  function info(content, printFull) {
105
- return this.printLogHelper(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.info);
105
+ return this.printLog(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.info);
106
106
  }
107
107
  function imp(content, printFull) {
108
- return this.printLogHelper(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.imp);
108
+ return this.printLog(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.imp);
109
109
  }
110
110
  function warn(content, printFull) {
111
- return this.printLogHelper(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.warn);
111
+ return this.printLog(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.warn);
112
112
  }
113
113
  function err(content, printFull) {
114
- return this.printLogHelper(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.err);
115
- }
116
- function printLogHelper(content, printFull, level) {
117
- return printLog(content, printFull, level, this.settings.mode, this.settings.timestamp, this.settings.format, this.settings.filePath, this.settings.customLogger);
114
+ return this.printLog(content, printFull !== null && printFull !== void 0 ? printFull : false, levels.err);
118
115
  }
119
- function printLog(content, printFull, level, mode, timestamp, format, filePath, customLogger) {
116
+ function printLog(content, printFull, level) {
117
+ var _a = this.settings, mode = _a.mode, format = _a.format, timestamp = _a.timestamp, filePath = _a.filePath, customLogger = _a.customLogger;
120
118
  if (mode === LoggerModes.Off) {
121
119
  return;
122
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jet-logger",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A super quick, easy to setup logging tool for NodeJS/TypeScript.",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",