@stackone/logger 0.1.4 → 0.1.5

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.
@@ -0,0 +1,80 @@
1
+ //#region src/types.d.ts
2
+ interface ILogger {
3
+ debug({
4
+ category,
5
+ message,
6
+ traceId,
7
+ context
8
+ }: {
9
+ category?: string;
10
+ message: string;
11
+ traceId?: string;
12
+ context?: Record<string, unknown>;
13
+ }): void;
14
+ info({
15
+ category,
16
+ message,
17
+ traceId,
18
+ context
19
+ }: {
20
+ category?: string;
21
+ message: string;
22
+ traceId?: string;
23
+ context?: Record<string, unknown>;
24
+ }): void;
25
+ warning({
26
+ category,
27
+ message,
28
+ traceId,
29
+ error,
30
+ code,
31
+ context
32
+ }: {
33
+ category?: string;
34
+ message: string;
35
+ traceId?: string;
36
+ error?: LogError;
37
+ code?: string;
38
+ context?: Record<string, unknown>;
39
+ }): void;
40
+ error({
41
+ category,
42
+ message,
43
+ traceId,
44
+ error,
45
+ code,
46
+ context
47
+ }: {
48
+ category?: string;
49
+ message: string;
50
+ traceId?: string;
51
+ error?: LogError;
52
+ code: string;
53
+ context?: Record<string, unknown>;
54
+ }): void;
55
+ }
56
+ type LogError = Error & {
57
+ response?: {
58
+ data?: unknown;
59
+ };
60
+ context?: Record<string, unknown>;
61
+ url?: string;
62
+ };
63
+ declare enum LogLevel {
64
+ Trace = 0,
65
+ Debug = 1,
66
+ Info = 2,
67
+ Warning = 3,
68
+ Error = 4,
69
+ }
70
+ type Log = {
71
+ level: LogLevel;
72
+ category?: string;
73
+ message: string;
74
+ traceId?: string;
75
+ error?: LogError;
76
+ code?: string;
77
+ context?: Record<string, unknown>;
78
+ };
79
+ //#endregion
80
+ export { ILogger, Log, LogError, LogLevel };
@@ -0,0 +1,80 @@
1
+ //#region src/types.d.ts
2
+ interface ILogger {
3
+ debug({
4
+ category,
5
+ message,
6
+ traceId,
7
+ context
8
+ }: {
9
+ category?: string;
10
+ message: string;
11
+ traceId?: string;
12
+ context?: Record<string, unknown>;
13
+ }): void;
14
+ info({
15
+ category,
16
+ message,
17
+ traceId,
18
+ context
19
+ }: {
20
+ category?: string;
21
+ message: string;
22
+ traceId?: string;
23
+ context?: Record<string, unknown>;
24
+ }): void;
25
+ warning({
26
+ category,
27
+ message,
28
+ traceId,
29
+ error,
30
+ code,
31
+ context
32
+ }: {
33
+ category?: string;
34
+ message: string;
35
+ traceId?: string;
36
+ error?: LogError;
37
+ code?: string;
38
+ context?: Record<string, unknown>;
39
+ }): void;
40
+ error({
41
+ category,
42
+ message,
43
+ traceId,
44
+ error,
45
+ code,
46
+ context
47
+ }: {
48
+ category?: string;
49
+ message: string;
50
+ traceId?: string;
51
+ error?: LogError;
52
+ code: string;
53
+ context?: Record<string, unknown>;
54
+ }): void;
55
+ }
56
+ type LogError = Error & {
57
+ response?: {
58
+ data?: unknown;
59
+ };
60
+ context?: Record<string, unknown>;
61
+ url?: string;
62
+ };
63
+ declare enum LogLevel {
64
+ Trace = 0,
65
+ Debug = 1,
66
+ Info = 2,
67
+ Warning = 3,
68
+ Error = 4,
69
+ }
70
+ type Log = {
71
+ level: LogLevel;
72
+ category?: string;
73
+ message: string;
74
+ traceId?: string;
75
+ error?: LogError;
76
+ code?: string;
77
+ context?: Record<string, unknown>;
78
+ };
79
+ //#endregion
80
+ export { ILogger, Log, LogError, LogLevel };
package/dist/index.js CHANGED
@@ -1 +1,13 @@
1
- "use strict";var r;exports.LogLevel=void 0,(r=exports.LogLevel||(exports.LogLevel={}))[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Info=2]="Info",r[r.Warning=3]="Warning",r[r.Error=4]="Error";
1
+
2
+ //#region src/types.ts
3
+ let LogLevel = /* @__PURE__ */ function(LogLevel$1) {
4
+ LogLevel$1[LogLevel$1["Trace"] = 0] = "Trace";
5
+ LogLevel$1[LogLevel$1["Debug"] = 1] = "Debug";
6
+ LogLevel$1[LogLevel$1["Info"] = 2] = "Info";
7
+ LogLevel$1[LogLevel$1["Warning"] = 3] = "Warning";
8
+ LogLevel$1[LogLevel$1["Error"] = 4] = "Error";
9
+ return LogLevel$1;
10
+ }({});
11
+
12
+ //#endregion
13
+ exports.LogLevel = LogLevel;
package/dist/index.mjs ADDED
@@ -0,0 +1,12 @@
1
+ //#region src/types.ts
2
+ let LogLevel = /* @__PURE__ */ function(LogLevel$1) {
3
+ LogLevel$1[LogLevel$1["Trace"] = 0] = "Trace";
4
+ LogLevel$1[LogLevel$1["Debug"] = 1] = "Debug";
5
+ LogLevel$1[LogLevel$1["Info"] = 2] = "Info";
6
+ LogLevel$1[LogLevel$1["Warning"] = 3] = "Warning";
7
+ LogLevel$1[LogLevel$1["Error"] = 4] = "Error";
8
+ return LogLevel$1;
9
+ }({});
10
+
11
+ //#endregion
12
+ export { LogLevel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/logger",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.mjs",
@@ -10,12 +10,20 @@
10
10
  "package.json",
11
11
  "README.md"
12
12
  ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/types/index.d.ts",
16
+ "import": "./dist/index.es.mjs",
17
+ "require": "./dist/index.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
13
21
  "scripts": {
14
22
  "clean": "rimraf dist",
15
23
  "prebuild": "npm run clean",
16
- "build": "rollup -c --environment NODE_ENV:production",
24
+ "build": "tsdown --env.NODE_ENV=production",
17
25
  "prebuild:dev": "npm run clean",
18
- "build:dev": "rollup -c --environment NODE_ENV:development",
26
+ "build:dev": "tsdown --env.NODE_ENV=development",
19
27
  "code:format": "biome format ./src ./*.mjs",
20
28
  "code:format:fix": "biome format --write ./src ./*.mjs",
21
29
  "code:lint": "biome lint --error-on-warnings ./src ./*.mjs",
@@ -31,5 +39,15 @@
31
39
  "keywords": [],
32
40
  "author": "StackOne",
33
41
  "license": "ISC",
34
- "dependencies": {}
42
+ "dependencies": {},
43
+ "devDependencies": {
44
+ "tsdown": "^0.12.9"
45
+ },
46
+ "tsdown": {
47
+ "dts": true,
48
+ "format": [
49
+ "esm",
50
+ "cjs"
51
+ ]
52
+ }
35
53
  }
package/dist/index.es.mjs DELETED
@@ -1 +0,0 @@
1
- var r;!function(r){r[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Info=2]="Info",r[r.Warning=3]="Warning",r[r.Error=4]="Error"}(r||(r={}));export{r as LogLevel};
@@ -1,2 +0,0 @@
1
- export type { ILogger, Log, LogError } from './types';
2
- export { LogLevel } from './types';
@@ -1,53 +0,0 @@
1
- export interface ILogger {
2
- debug({ category, message, traceId, context, }: {
3
- category?: string;
4
- message: string;
5
- traceId?: string;
6
- context?: Record<string, unknown>;
7
- }): void;
8
- info({ category, message, traceId, context, }: {
9
- category?: string;
10
- message: string;
11
- traceId?: string;
12
- context?: Record<string, unknown>;
13
- }): void;
14
- warning({ category, message, traceId, error, code, context, }: {
15
- category?: string;
16
- message: string;
17
- traceId?: string;
18
- error?: LogError;
19
- code?: string;
20
- context?: Record<string, unknown>;
21
- }): void;
22
- error({ category, message, traceId, error, code, context, }: {
23
- category?: string;
24
- message: string;
25
- traceId?: string;
26
- error?: LogError;
27
- code: string;
28
- context?: Record<string, unknown>;
29
- }): void;
30
- }
31
- export type LogError = Error & {
32
- response?: {
33
- data?: unknown;
34
- };
35
- context?: Record<string, unknown>;
36
- url?: string;
37
- };
38
- export declare enum LogLevel {
39
- Trace = 0,
40
- Debug = 1,
41
- Info = 2,
42
- Warning = 3,
43
- Error = 4
44
- }
45
- export type Log = {
46
- level: LogLevel;
47
- category?: string;
48
- message: string;
49
- traceId?: string;
50
- error?: LogError;
51
- code?: string;
52
- context?: Record<string, unknown>;
53
- };