jsonl-logger 0.1.2 → 0.2.1
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/README.md +17 -15
- package/dist/google-cloud-logging.js +1 -1
- package/dist/index.js +3 -1
- package/dist/intercept.js +3 -1
- package/dist/preload.js +3 -1
- package/dist/types.d.ts +2 -0
- package/dist/victoria-logs.js +1 -1
- package/package.json +5 -3
- package/src/index.ts +18 -3
- package/src/preload.ts +12 -11
- package/src/types.ts +3 -0
- package/dist/index-5vvjt922.js +0 -2
- package/dist/index-abhqk8y0.js +0 -4
- package/dist/index-c56gnbme.js +0 -2
- package/dist/index-jvj9ywjg.js +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# jsonl-logger
|
|
2
2
|
|
|
3
|
-
Lightweight JSON Lines logger with pluggable formatters. Modern ESM-only, zero dependencies, Bun-first, works on Node.js and Deno.
|
|
3
|
+
Lightweight JSON Lines (JSONL) logger with pluggable formatters. Modern ESM-only, zero dependencies, Bun-first, works on Node.js and Deno.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -19,24 +19,29 @@ logger.info('Server started', { port: 3000 })
|
|
|
19
19
|
logger.error('Request failed', { path: '/api' }, new Error('timeout'))
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Without `LOG_FORMAT`, the logger outputs colored plain text — ideal for local development. Set `LOG_FORMAT` to enable structured JSON for production (see Formatters below).
|
|
23
|
+
|
|
22
24
|
## Formatters
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
Set `LOG_FORMAT` to enable JSON output with a specific formatter:
|
|
25
27
|
|
|
26
|
-
### Google Cloud Logging
|
|
28
|
+
### Google Cloud Logging
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
LOG_FORMAT=google-cloud-logging bun run server.ts
|
|
32
|
+
```
|
|
27
33
|
|
|
28
34
|
```typescript
|
|
29
|
-
import { logger } from 'jsonl-logger'
|
|
30
35
|
// Output: {"message":"...","timestamp":"...","severity":"INFO",...}
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
### VictoriaLogs
|
|
34
39
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
```bash
|
|
41
|
+
LOG_FORMAT=victoria-logs bun run server.ts
|
|
42
|
+
```
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
```typescript
|
|
40
45
|
// Output: {"_msg":"...","_time":"...","level":"info",...}
|
|
41
46
|
```
|
|
42
47
|
|
|
@@ -82,12 +87,10 @@ originalConsole.log('bypass interception')
|
|
|
82
87
|
Auto-intercept from first line using `--preload`:
|
|
83
88
|
|
|
84
89
|
```bash
|
|
85
|
-
bun --preload jsonl-logger/preload server.js
|
|
90
|
+
LOG_FORMAT=victoria-logs bun --preload jsonl-logger/preload server.js
|
|
86
91
|
```
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
- `LOG_FORMAT` — `google-cloud-logging` (default) or `victoria-logs`
|
|
90
|
-
- `LOG_LEVEL` — `debug`, `info` (default), `warn`, `error`, `fatal`
|
|
93
|
+
The preload module reads `LOG_FORMAT` and only activates when it's set. Safe to include unconditionally — it's a no-op without `LOG_FORMAT`.
|
|
91
94
|
|
|
92
95
|
## Child Loggers
|
|
93
96
|
|
|
@@ -101,9 +104,8 @@ requestLogger.info('Processing request')
|
|
|
101
104
|
|
|
102
105
|
| Variable | Default | Description |
|
|
103
106
|
|----------|---------|-------------|
|
|
104
|
-
| `
|
|
105
|
-
| `LOG_LEVEL` | `info`/`debug` | Minimum log level (
|
|
106
|
-
| `LOG_FORMAT` | `google-cloud-logging` | Formatter for preload module (`google-cloud-logging` or `victoria-logs`) |
|
|
107
|
+
| `LOG_FORMAT` | _(unset)_ | Set to enable JSON: `google-cloud-logging` or `victoria-logs` |
|
|
108
|
+
| `LOG_LEVEL` | `info`/`debug` | Minimum log level (`info` when JSON, `debug` otherwise) |
|
|
107
109
|
|
|
108
110
|
## Runtime Detection
|
|
109
111
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t={debug:"DEBUG",info:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},o={messageKey:"message",format(e){let r={message:e.message,timestamp:e.timestamp,severity:t[e.level],...e.context};if(e.error){if(r["error.name"]=e.error.name,r["error.message"]=e.error.message,e.error.stack)r["error.stack"]=e.error.stack}return r}};export{o as GoogleCloudLogging};
|
package/dist/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var C={debug:"DEBUG",info:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},a={messageKey:"message",format(o){let t={message:o.message,timestamp:o.timestamp,severity:C[o.level],...o.context};if(o.error){if(t["error.name"]=o.error.name,t["error.message"]=o.error.message,o.error.stack)t["error.stack"]=o.error.stack}return t}};var f={messageKey:"_msg",format(o){let t={_msg:o.message,_time:o.timestamp,level:o.level,...o.context};if(o.error){if(t["error.name"]=o.error.name,t["error.message"]=o.error.message,o.error.stack)t["error.stack"]=o.error.stack}return t}};var i=process.env.LOG_FORMAT,v=!!i,n={debug:0,info:1,warn:2,error:3,fatal:4},k=/\x1b\[[0-9;]*m/g;function l(o){return o.replace(k,"")}var m=typeof process<"u"&&process.stdout&&typeof process.stdout.write==="function"?"node":typeof Deno<"u"&&Deno.stdout?"deno":"browser",p=m==="deno"?new TextEncoder:null;function x(o,t){if(m==="node")(t?process.stderr??process.stdout:process.stdout).write(`${o}
|
|
2
|
+
`);else if(m==="deno"&&p){let e=p.encode(`${o}
|
|
3
|
+
`);if(t)Deno.stderr.writeSync(e);else Deno.stdout.writeSync(e)}else if(t)console.error(o);else console.log(o)}var y={"google-cloud-logging":a,"victoria-logs":f},F=i&&y[i]||a,u=v,O=process.env.LOG_LEVEL||(u?"info":"debug"),d={debug:!1,info:!1,warn:!1,error:!0,fatal:!0};class L{ctx;min;json;fmt;constructor(o,t){this.ctx=o||{},this.json=t?.json??u,this.fmt=t?.formatter??F;let e=t?.level??O;this.min=n[e]??n.info}child(o){let t=new L({...this.ctx,...o},{json:this.json,formatter:this.fmt});return t.min=this.min,t}log(o,t,e,r){if(n[o]<this.min)return;let s={level:o,message:this.json?l(t).trim():t,timestamp:new Date().toISOString(),context:e?{...this.ctx,...e}:this.ctx};if(r)s.error={name:r.name,message:r.message,stack:r.stack};if(this.json)x(JSON.stringify(this.fmt.format(s)),d[o]);else this.logPlain(o,s)}logPlain(o,t){let e={debug:"\x1B[36m",info:"\x1B[32m",warn:"\x1B[33m",error:"\x1B[31m",fatal:"\x1B[35m"},r="\x1B[0m",s=e[o],h=new Date(t.timestamp).toLocaleTimeString("en-US",{hour12:!1}),R=o.toUpperCase().padEnd(5),c=t.context,w=Object.keys(c).length>0?` ${JSON.stringify(c)}`:"",b=t.error?` [${t.error.name}: ${t.error.message}]`:"",g=`${s}${h} ${R}\x1B[0m ${t.message}${w}${b}`;switch(o){case"debug":console.debug(g);break;case"warn":console.warn(g);break;case"error":case"fatal":console.error(g);break;default:console.log(g)}}debug(o,t){this.log("debug",o,t)}info(o,t){this.log("info",o,t)}warn(o,t){this.log("warn",o,t)}error(o,t,e){this.log("error",o,t,e)}fatal(o,t,e){this.log("fatal",o,t,e)}}var V=new L;export{l as stripAnsi,V as logger,n as logLevelValues,L as Logger};
|
package/dist/intercept.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var Q={debug:"DEBUG",info:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},W={messageKey:"message",format(R){let k={message:R.message,timestamp:R.timestamp,severity:Q[R.level],...R.context};if(R.error){if(k["error.name"]=R.error.name,k["error.message"]=R.error.message,R.error.stack)k["error.stack"]=R.error.stack}return k}};var X=process.env.LOG_FORMAT,L=!!X,T={debug:0,info:1,warn:2,error:3,fatal:4},Y=/\x1b\[[0-9;]*m/g;function q(R){return R.replace(Y,"")}var B=typeof process<"u"&&process.stdout&&typeof process.stdout.write==="function"?"node":typeof Deno<"u"&&Deno.stdout?"deno":"browser",j=B==="deno"?new TextEncoder:null;function U(R,k){if(B==="node")(k?process.stderr??process.stdout:process.stdout).write(`${R}
|
|
2
|
+
`);else if(B==="deno"&&j){let I=j.encode(`${R}
|
|
3
|
+
`);if(k)Deno.stderr.writeSync(I);else Deno.stdout.writeSync(I)}else if(k)console.error(R);else console.log(R)}var S={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};function Z(...R){let k="";for(let I=0;I<R.length;I++){if(I>0)k+=" ";let C=R[I];if(typeof C==="string")k+=q(C);else if(C instanceof Error)k+=C.message;else try{k+=JSON.stringify(C)}catch{k+=String(C)}}return k.trim()}function _(...R){let k;for(let I of R)if(typeof I==="object"&&I!==null&&!(I instanceof Error)&&!Array.isArray(I)){if(!k)k={};Object.assign(k,I)}return k}function $(...R){for(let k of R)if(k instanceof Error)return k}var w={debug:!1,info:!1,warn:!1,error:!0,fatal:!0};function y(R,k,I,C){let A=`"${k.messageKey}"`;return(...F)=>{if(F.length===1&&typeof F[0]==="string"&&F[0].charCodeAt(0)===123&&F[0].includes(A)){U(F[0],w[R]);return}if(T[R]<I)return;let G=Z(...F);if(C&&!C(R,G))return;let H=_(...F),N=$(...F),O={level:R,message:G,timestamp:new Date().toISOString(),context:H||{},error:N?{name:N.name,message:N.message,stack:N.stack}:void 0};U(JSON.stringify(k.format(O)),w[R])}}var z="__jsonlLoggerIntercepted";function V(R){if(globalThis[z])return;globalThis[z]=!0;let k=R?.formatter??W,I=T[R?.level??"debug"],C=R?.filter,A=[["log","info"],["info","info"],["warn","warn"],["error","error"],["debug","debug"]];for(let[F,G]of A)console[F]=y(G,k,I,C)}export{S as originalConsole,V as intercept};
|
package/dist/preload.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var V={debug:"DEBUG",info:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},F={messageKey:"message",format(m){let n={message:m.message,timestamp:m.timestamp,severity:V[m.level],...m.context};if(m.error){if(n["error.name"]=m.error.name,n["error.message"]=m.error.message,m.error.stack)n["error.stack"]=m.error.stack}return n}};var _={messageKey:"_msg",format(m){let n={_msg:m.message,_time:m.timestamp,level:m.level,...m.context};if(m.error){if(n["error.name"]=m.error.name,n["error.message"]=m.error.message,m.error.stack)n["error.stack"]=m.error.stack}return n}};var p=process.env.LOG_FORMAT,Q=!!p,I={debug:0,info:1,warn:2,error:3,fatal:4},W=/\x1b\[[0-9;]*m/g;function C(m){return m.replace(W,"")}var G=typeof process<"u"&&process.stdout&&typeof process.stdout.write==="function"?"node":typeof Deno<"u"&&Deno.stdout?"deno":"browser",w=G==="deno"?new TextEncoder:null;function N(m,n){if(G==="node")(n?process.stderr??process.stdout:process.stdout).write(`${m}
|
|
2
|
+
`);else if(G==="deno"&&w){let R=w.encode(`${m}
|
|
3
|
+
`);if(n)Deno.stderr.writeSync(R);else Deno.stdout.writeSync(R)}else if(n)console.error(m);else console.log(m)}var $={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};function c(...m){let n="";for(let R=0;R<m.length;R++){if(R>0)n+=" ";let o=m[R];if(typeof o==="string")n+=C(o);else if(o instanceof Error)n+=o.message;else try{n+=JSON.stringify(o)}catch{n+=String(o)}}return n.trim()}function j(...m){let n;for(let R of m)if(typeof R==="object"&&R!==null&&!(R instanceof Error)&&!Array.isArray(R)){if(!n)n={};Object.assign(n,R)}return n}function q(...m){for(let n of m)if(n instanceof Error)return n}var A={debug:!1,info:!1,warn:!1,error:!0,fatal:!0};function t(m,n,R,o){let y=`"${n.messageKey}"`;return(...k)=>{if(k.length===1&&typeof k[0]==="string"&&k[0].charCodeAt(0)===123&&k[0].includes(y)){N(k[0],A[m]);return}if(I[m]<R)return;let f=c(...k);if(o&&!o(m,f))return;let T=j(...k),L=q(...k),U={level:m,message:f,timestamp:new Date().toISOString(),context:T||{},error:L?{name:L.name,message:L.message,stack:L.stack}:void 0};N(JSON.stringify(n.format(U)),A[m])}}var B="__jsonlLoggerIntercepted";function O(m){if(globalThis[B])return;globalThis[B]=!0;let n=m?.formatter??F,R=I[m?.level??"debug"],o=m?.filter,y=[["log","info"],["info","info"],["warn","warn"],["error","error"],["debug","debug"]];for(let[k,f]of y)console[k]=t(f,n,R,o)}if(p){let n={"google-cloud-logging":F,"victoria-logs":_}[p]??F,R=process.env.LOG_LEVEL||"info";O({formatter:n,level:R})}
|
package/dist/types.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type LoggerOptions = {
|
|
|
21
21
|
level?: LogLevel;
|
|
22
22
|
};
|
|
23
23
|
export type FormatterName = 'google-cloud-logging' | 'victoria-logs';
|
|
24
|
+
export declare const defaultFormat: FormatterName | undefined;
|
|
25
|
+
export declare const isJsonMode: boolean;
|
|
24
26
|
export type InterceptOptions = {
|
|
25
27
|
formatter?: Formatter;
|
|
26
28
|
filter?: (level: LogLevel, message: string) => boolean;
|
package/dist/victoria-logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t={messageKey:"_msg",format(e){let r={_msg:e.message,_time:e.timestamp,level:e.level,...e.context};if(e.error){if(r["error.name"]=e.error.name,r["error.message"]=e.error.message,e.error.stack)r["error.stack"]=e.error.stack}return r}};export{t as VictoriaLogs};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonl-logger",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Lightweight ESM-only JSON Lines logger with pluggable formatters for Google Cloud Logging, VictoriaLogs, and more",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,11 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
40
|
-
"src"
|
|
40
|
+
"src",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"README.md"
|
|
41
43
|
],
|
|
42
44
|
"scripts": {
|
|
43
45
|
"build": "bun run build:js && bun run build:types",
|
|
44
|
-
"build:js": "bun build src/index.ts src/google-cloud-logging.ts src/victoria-logs.ts src/intercept.ts src/preload.ts --outdir dist --target node --format esm --
|
|
46
|
+
"build:js": "bun build src/index.ts src/google-cloud-logging.ts src/victoria-logs.ts src/intercept.ts src/preload.ts --outdir dist --target node --format esm --minify",
|
|
45
47
|
"build:types": "tsc --emitDeclarationOnly",
|
|
46
48
|
"lint": "biome check --write .",
|
|
47
49
|
"test": "bun test"
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { GoogleCloudLogging } from './google-cloud-logging'
|
|
2
2
|
import type {
|
|
3
3
|
Formatter,
|
|
4
|
+
FormatterName,
|
|
4
5
|
LogContext,
|
|
5
6
|
LoggerOptions,
|
|
6
7
|
LogLevel,
|
|
7
8
|
LogRecord,
|
|
8
9
|
} from './types'
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
defaultFormat,
|
|
12
|
+
isJsonMode,
|
|
13
|
+
logLevelValues,
|
|
14
|
+
stripAnsi,
|
|
15
|
+
write,
|
|
16
|
+
} from './types'
|
|
17
|
+
import { VictoriaLogs } from './victoria-logs'
|
|
10
18
|
|
|
11
19
|
export type {
|
|
12
20
|
Formatter,
|
|
@@ -19,7 +27,14 @@ export type {
|
|
|
19
27
|
} from './types'
|
|
20
28
|
export { logLevelValues, stripAnsi } from './types'
|
|
21
29
|
|
|
22
|
-
const
|
|
30
|
+
const formatters: Record<FormatterName, Formatter> = {
|
|
31
|
+
'google-cloud-logging': GoogleCloudLogging,
|
|
32
|
+
'victoria-logs': VictoriaLogs,
|
|
33
|
+
}
|
|
34
|
+
const defaultFormatter =
|
|
35
|
+
(defaultFormat && formatters[defaultFormat]) || GoogleCloudLogging
|
|
36
|
+
|
|
37
|
+
const defaultJson = isJsonMode
|
|
23
38
|
const defaultLevel: LogLevel =
|
|
24
39
|
(process.env.LOG_LEVEL as LogLevel | undefined) ||
|
|
25
40
|
(defaultJson ? 'info' : 'debug')
|
|
@@ -41,7 +56,7 @@ export class Logger {
|
|
|
41
56
|
constructor(context?: LogContext, options?: LoggerOptions) {
|
|
42
57
|
this.ctx = context || {}
|
|
43
58
|
this.json = options?.json ?? defaultJson
|
|
44
|
-
this.fmt = options?.formatter ??
|
|
59
|
+
this.fmt = options?.formatter ?? defaultFormatter
|
|
45
60
|
const level: LogLevel = options?.level ?? defaultLevel
|
|
46
61
|
this.min = logLevelValues[level] ?? logLevelValues.info
|
|
47
62
|
}
|
package/src/preload.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { GoogleCloudLogging } from './google-cloud-logging'
|
|
2
2
|
import { intercept } from './intercept'
|
|
3
3
|
import type { Formatter, FormatterName } from './types'
|
|
4
|
+
import { defaultFormat } from './types'
|
|
4
5
|
import { VictoriaLogs } from './victoria-logs'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
if (defaultFormat) {
|
|
8
|
+
const formatters: Record<FormatterName, Formatter> = {
|
|
9
|
+
'google-cloud-logging': GoogleCloudLogging,
|
|
10
|
+
'victoria-logs': VictoriaLogs,
|
|
11
|
+
}
|
|
10
12
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(process.env.LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | 'fatal') ||
|
|
16
|
-
'info'
|
|
13
|
+
const formatter = formatters[defaultFormat] ?? GoogleCloudLogging
|
|
14
|
+
const level =
|
|
15
|
+
(process.env.LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | 'fatal') ||
|
|
16
|
+
'info'
|
|
17
17
|
|
|
18
|
-
intercept({ formatter, level })
|
|
18
|
+
intercept({ formatter, level })
|
|
19
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -23,6 +23,9 @@ export type LoggerOptions = {
|
|
|
23
23
|
|
|
24
24
|
export type FormatterName = 'google-cloud-logging' | 'victoria-logs'
|
|
25
25
|
|
|
26
|
+
export const defaultFormat = process.env.LOG_FORMAT as FormatterName | undefined
|
|
27
|
+
export const isJsonMode = !!defaultFormat
|
|
28
|
+
|
|
26
29
|
export type InterceptOptions = {
|
|
27
30
|
formatter?: Formatter
|
|
28
31
|
filter?: (level: LogLevel, message: string) => boolean
|
package/dist/index-5vvjt922.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as I,e as U,f as H}from"./index-abhqk8y0.js";import{g as T}from"./index-c56gnbme.js";var G={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};function Y(...j){let b="";for(let k=0;k<j.length;k++){if(k>0)b+=" ";let q=j[k];if(typeof q==="string")b+=U(q);else if(q instanceof Error)b+=q.message;else try{b+=JSON.stringify(q)}catch{b+=String(q)}}return b.trim()}function Z(...j){let b;for(let k of j)if(typeof k==="object"&&k!==null&&!(k instanceof Error)&&!Array.isArray(k)){if(!b)b={};Object.assign(b,k)}return b}function _(...j){for(let b of j)if(b instanceof Error)return b}var Q={debug:!1,info:!1,warn:!1,error:!0,fatal:!0};function $(j,b,k,q){let F=`"${b.messageKey}"`;return(...z)=>{if(z.length===1&&typeof z[0]==="string"&&z[0].charCodeAt(0)===123&&z[0].includes(F)){H(z[0],Q[j]);return}if(I[j]<k)return;let B=Y(...z);if(q&&!q(j,B))return;let W=Z(...z),D=_(...z),X={level:j,message:B,timestamp:new Date().toISOString(),context:W||{},error:D?{name:D.name,message:D.message,stack:D.stack}:void 0};H(JSON.stringify(b.format(X)),Q[j])}}var R="__jsonlLoggerIntercepted";function J(j){if(globalThis[R])return;globalThis[R]=!0;let b=j?.formatter??T,k=I[j?.level??"debug"],q=j?.filter,F=[["log","info"],["info","info"],["warn","warn"],["error","error"],["debug","debug"]];for(let[z,B]of F)console[z]=$(B,b,k,q)}
|
|
2
|
-
export{G as b,J as c};
|
package/dist/index-abhqk8y0.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var B={debug:0,info:1,warn:2,error:3,fatal:4},A=/\x1b\[[0-9;]*m/g;function C(h){return h.replace(A,"")}var w=typeof process<"u"&&process.stdout&&typeof process.stdout.write==="function"?"node":typeof Deno<"u"&&Deno.stdout?"deno":"browser",z=w==="deno"?new TextEncoder:null;function F(h,j){if(w==="node")(j?process.stderr??process.stdout:process.stdout).write(`${h}
|
|
2
|
-
`);else if(w==="deno"&&z){let q=z.encode(`${h}
|
|
3
|
-
`);if(j)Deno.stderr.writeSync(q);else Deno.stdout.writeSync(q)}else if(j)console.error(h);else console.log(h)}
|
|
4
|
-
export{B as d,C as e,F as f};
|
package/dist/index-c56gnbme.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t={debug:"DEBUG",info:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},o={messageKey:"message",format(e){let r={message:e.message,timestamp:e.timestamp,severity:t[e.level],...e.context};if(e.error){if(r["error.name"]=e.error.name,r["error.message"]=e.error.message,e.error.stack)r["error.stack"]=e.error.stack}return r}};
|
|
2
|
-
export{o as g};
|
package/dist/index-jvj9ywjg.js
DELETED