@akanjs/common 1.0.7-canary.5 → 1.0.8
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/Logger.d.ts +2 -2
- package/cjs/Logger.js +5 -5
- package/esm/Logger.js +5 -5
- package/package.json +1 -1
package/Logger.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class Logger {
|
|
|
23
23
|
static info(msg: string, context?: string): void;
|
|
24
24
|
static warn(msg: string, context?: string): void;
|
|
25
25
|
static error(msg: string, context?: string): void;
|
|
26
|
-
static rawLog(msg?: string, method?: "console" | "process"): void;
|
|
27
|
-
static raw(msg?: string, method?: "console" | "process"): void;
|
|
26
|
+
static rawLog(msg?: string, method?: "console" | "process", outputStream?: "log" | "error"): void;
|
|
27
|
+
static raw(msg?: string, method?: "console" | "process", outputStream?: "log" | "error"): void;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
package/cjs/Logger.js
CHANGED
|
@@ -160,14 +160,14 @@ class Logger {
|
|
|
160
160
|
console.log(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
161
161
|
`);
|
|
162
162
|
}
|
|
163
|
-
static rawLog(msg = "", method) {
|
|
163
|
+
static rawLog(msg = "", method, outputStream) {
|
|
164
164
|
this.raw(`${msg}
|
|
165
|
-
`, method);
|
|
165
|
+
`, method, outputStream);
|
|
166
166
|
}
|
|
167
|
-
static raw(msg = "", method) {
|
|
167
|
+
static raw(msg = "", method, outputStream) {
|
|
168
168
|
if (typeof window === "undefined" && method !== "console" && global.process)
|
|
169
|
-
global.process
|
|
169
|
+
global.process[outputStream === "error" ? "stderr" : "stdout"].write(msg);
|
|
170
170
|
else
|
|
171
|
-
console
|
|
171
|
+
console[outputStream === "error" ? "error" : "log"](msg.trim());
|
|
172
172
|
}
|
|
173
173
|
}
|
package/esm/Logger.js
CHANGED
|
@@ -128,15 +128,15 @@ class Logger {
|
|
|
128
128
|
console.log(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
129
129
|
`);
|
|
130
130
|
}
|
|
131
|
-
static rawLog(msg = "", method) {
|
|
131
|
+
static rawLog(msg = "", method, outputStream) {
|
|
132
132
|
this.raw(`${msg}
|
|
133
|
-
`, method);
|
|
133
|
+
`, method, outputStream);
|
|
134
134
|
}
|
|
135
|
-
static raw(msg = "", method) {
|
|
135
|
+
static raw(msg = "", method, outputStream) {
|
|
136
136
|
if (typeof window === "undefined" && method !== "console" && global.process)
|
|
137
|
-
global.process
|
|
137
|
+
global.process[outputStream === "error" ? "stderr" : "stdout"].write(msg);
|
|
138
138
|
else
|
|
139
|
-
console
|
|
139
|
+
console[outputStream === "error" ? "error" : "log"](msg.trim());
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
export {
|