@stackone/logger
Advanced tools
| //#region src/types.d.ts | ||
| interface ILogger { | ||
| debug({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| info({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| warning({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| error, | ||
| code, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| error({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| error, | ||
| code, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| } | ||
| type LogError = Error & { | ||
| response?: { | ||
| data?: unknown; | ||
| }; | ||
| context?: Record<string, unknown>; | ||
| url?: string; | ||
| }; | ||
| declare enum LogLevel { | ||
| Trace = 0, | ||
| Debug = 1, | ||
| Info = 2, | ||
| Warning = 3, | ||
| Error = 4, | ||
| } | ||
| type Log = { | ||
| level: LogLevel; | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }; | ||
| //#endregion | ||
| export { ILogger, Log, LogError, LogLevel }; |
| //#region src/types.d.ts | ||
| interface ILogger { | ||
| debug({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| info({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| warning({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| error, | ||
| code, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| error({ | ||
| category, | ||
| message, | ||
| traceId, | ||
| error, | ||
| code, | ||
| context | ||
| }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| } | ||
| type LogError = Error & { | ||
| response?: { | ||
| data?: unknown; | ||
| }; | ||
| context?: Record<string, unknown>; | ||
| url?: string; | ||
| }; | ||
| declare enum LogLevel { | ||
| Trace = 0, | ||
| Debug = 1, | ||
| Info = 2, | ||
| Warning = 3, | ||
| Error = 4, | ||
| } | ||
| type Log = { | ||
| level: LogLevel; | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }; | ||
| //#endregion | ||
| export { ILogger, Log, LogError, LogLevel }; |
| //#region src/types.ts | ||
| let LogLevel = /* @__PURE__ */ function(LogLevel$1) { | ||
| LogLevel$1[LogLevel$1["Trace"] = 0] = "Trace"; | ||
| LogLevel$1[LogLevel$1["Debug"] = 1] = "Debug"; | ||
| LogLevel$1[LogLevel$1["Info"] = 2] = "Info"; | ||
| LogLevel$1[LogLevel$1["Warning"] = 3] = "Warning"; | ||
| LogLevel$1[LogLevel$1["Error"] = 4] = "Error"; | ||
| return LogLevel$1; | ||
| }({}); | ||
| //#endregion | ||
| export { LogLevel }; |
+13
-1
@@ -1,1 +0,13 @@ | ||
| "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"; | ||
| //#region src/types.ts | ||
| let LogLevel = /* @__PURE__ */ function(LogLevel$1) { | ||
| LogLevel$1[LogLevel$1["Trace"] = 0] = "Trace"; | ||
| LogLevel$1[LogLevel$1["Debug"] = 1] = "Debug"; | ||
| LogLevel$1[LogLevel$1["Info"] = 2] = "Info"; | ||
| LogLevel$1[LogLevel$1["Warning"] = 3] = "Warning"; | ||
| LogLevel$1[LogLevel$1["Error"] = 4] = "Error"; | ||
| return LogLevel$1; | ||
| }({}); | ||
| //#endregion | ||
| exports.LogLevel = LogLevel; |
+22
-4
| { | ||
| "name": "@stackone/logger", | ||
| "version": "0.1.4", | ||
| "version": "0.1.5", | ||
| "description": "", | ||
@@ -13,8 +13,16 @@ "main": "dist/index.js", | ||
| ], | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/types/index.d.ts", | ||
| "import": "./dist/index.es.mjs", | ||
| "require": "./dist/index.js" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "scripts": { | ||
| "clean": "rimraf dist", | ||
| "prebuild": "npm run clean", | ||
| "build": "rollup -c --environment NODE_ENV:production", | ||
| "build": "tsdown --env.NODE_ENV=production", | ||
| "prebuild:dev": "npm run clean", | ||
| "build:dev": "rollup -c --environment NODE_ENV:development", | ||
| "build:dev": "tsdown --env.NODE_ENV=development", | ||
| "code:format": "biome format ./src ./*.mjs", | ||
@@ -35,3 +43,13 @@ "code:format:fix": "biome format --write ./src ./*.mjs", | ||
| "license": "ISC", | ||
| "dependencies": {} | ||
| "dependencies": {}, | ||
| "devDependencies": { | ||
| "tsdown": "^0.12.9" | ||
| }, | ||
| "tsdown": { | ||
| "dts": true, | ||
| "format": [ | ||
| "esm", | ||
| "cjs" | ||
| ] | ||
| } | ||
| } |
| 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}; |
| export type { ILogger, Log, LogError } from './types'; | ||
| export { LogLevel } from './types'; |
| export interface ILogger { | ||
| debug({ category, message, traceId, context, }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| info({ category, message, traceId, context, }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| warning({ category, message, traceId, error, code, context, }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| error({ category, message, traceId, error, code, context, }: { | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code: string; | ||
| context?: Record<string, unknown>; | ||
| }): void; | ||
| } | ||
| export type LogError = Error & { | ||
| response?: { | ||
| data?: unknown; | ||
| }; | ||
| context?: Record<string, unknown>; | ||
| url?: string; | ||
| }; | ||
| export declare enum LogLevel { | ||
| Trace = 0, | ||
| Debug = 1, | ||
| Info = 2, | ||
| Warning = 3, | ||
| Error = 4 | ||
| } | ||
| export type Log = { | ||
| level: LogLevel; | ||
| category?: string; | ||
| message: string; | ||
| traceId?: string; | ||
| error?: LogError; | ||
| code?: string; | ||
| context?: Record<string, unknown>; | ||
| }; |
5819
54.88%99
73.68%1
Infinity%