@ttoss/logger 0.3.11 → 0.3.13
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/package.json +3 -4
- package/src/index.ts +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/logger",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Simple environment agnostic logger",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -20,13 +20,12 @@
|
|
|
20
20
|
},
|
|
21
21
|
"module": "dist/esm/index.js",
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
24
|
-
"src"
|
|
23
|
+
"dist"
|
|
25
24
|
],
|
|
26
25
|
"sideEffects": false,
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"tsup": "^8.3.0",
|
|
29
|
-
"@ttoss/config": "^1.
|
|
28
|
+
"@ttoss/config": "^1.34.1"
|
|
30
29
|
},
|
|
31
30
|
"keywords": [],
|
|
32
31
|
"publishConfig": {
|
package/src/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const { log, warn, error } = console;
|
|
2
|
-
|
|
3
|
-
export const Logger = (isDev?: boolean) => {
|
|
4
|
-
const devEnv = isDev !== undefined ? isDev : true;
|
|
5
|
-
|
|
6
|
-
return (prefix: string) => {
|
|
7
|
-
return {
|
|
8
|
-
warn: (value: string) => {
|
|
9
|
-
if (devEnv) {
|
|
10
|
-
const now = new Date();
|
|
11
|
-
warn(`[${now}] - ${prefix} - ${value}`);
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
info: (value: string) => {
|
|
15
|
-
if (devEnv) {
|
|
16
|
-
const now = new Date();
|
|
17
|
-
log(`[${now}] - ${prefix} - ${value}`);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
error: (value: string) => {
|
|
21
|
-
const now = new Date();
|
|
22
|
-
error(`[${now}] - ${prefix} - ${value}`);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|