@larvit/log 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts ADDED
@@ -0,0 +1,129 @@
1
+ export type Metadata = {
2
+ [key: string]: string;
3
+ };
4
+ export type LogShorthand = (msg: string, metadata?: Metadata) => void;
5
+ export type LogInt = {
6
+ conf: LogConf;
7
+ spanId: string;
8
+ traceId: string;
9
+ error: LogShorthand;
10
+ warn: LogShorthand;
11
+ info: LogShorthand;
12
+ verbose: LogShorthand;
13
+ debug: LogShorthand;
14
+ silly: LogShorthand;
15
+ end: () => void;
16
+ };
17
+ export declare const LogLevels: {
18
+ error: {
19
+ otlpSeverityNumber: number;
20
+ otlpSeverityText: string;
21
+ };
22
+ warn: {
23
+ otlpSeverityNumber: number;
24
+ otlpSeverityText: string;
25
+ };
26
+ info: {
27
+ otlpSeverityNumber: number;
28
+ otlpSeverityText: string;
29
+ };
30
+ verbose: {
31
+ otlpSeverityNumber: number;
32
+ otlpSeverityText: string;
33
+ };
34
+ debug: {
35
+ otlpSeverityNumber: number;
36
+ otlpSeverityText: string;
37
+ };
38
+ silly: {
39
+ otlpSeverityNumber: number;
40
+ otlpSeverityText: string;
41
+ };
42
+ };
43
+ export type LogLevel = keyof typeof LogLevels;
44
+ export type EntryFormatterConf = {
45
+ logLevel: LogLevel;
46
+ metadata?: Metadata;
47
+ msTimestamp?: number;
48
+ msg: string;
49
+ };
50
+ export type LogConf = {
51
+ context?: Metadata;
52
+ entryFormatter?: (conf: EntryFormatterConf) => string;
53
+ format?: "text" | "json";
54
+ logLevel?: LogLevel | "none";
55
+ otlpAdditionalHeaders?: Record<string, string>;
56
+ otlpHttpBaseURI?: string;
57
+ parentLog?: LogInt;
58
+ printTraceInfo?: boolean;
59
+ spanName?: string;
60
+ stderr?: (msg: string) => void;
61
+ stdout?: (msg: string) => void;
62
+ };
63
+ export type OtlpAttribute = {
64
+ key: string;
65
+ value: {
66
+ stringValue: string;
67
+ };
68
+ };
69
+ export type OtlpSpanPayload = {
70
+ resourceSpans: {
71
+ resource: {
72
+ attributes: OtlpAttribute[];
73
+ };
74
+ scopeSpans: {
75
+ spans: {
76
+ attributes?: OtlpAttribute[];
77
+ endTimeUnixNano: string;
78
+ kind: 0 | 1 | 2 | 3 | 4 | 5;
79
+ name: string;
80
+ parentSpanId?: string;
81
+ spanId: string;
82
+ startTimeUnixNano: string;
83
+ traceId: string;
84
+ }[];
85
+ }[];
86
+ }[];
87
+ };
88
+ export type OtlpLogPayload = {
89
+ resourceLogs: {
90
+ resource: {
91
+ attributes: OtlpAttribute[];
92
+ };
93
+ scopeLogs: {
94
+ logRecords: {
95
+ attributes?: OtlpAttribute[];
96
+ body: {
97
+ stringValue: string;
98
+ };
99
+ severityNumber: number;
100
+ severityText: string;
101
+ spanId?: string;
102
+ timeUnixNano: string;
103
+ traceId?: string;
104
+ }[];
105
+ }[];
106
+ }[];
107
+ };
108
+ export declare function msgJsonFormatter(conf: EntryFormatterConf): string;
109
+ export declare function msgTextFormatter(conf: EntryFormatterConf): string;
110
+ export declare class Log implements LogInt {
111
+ #private;
112
+ context: Metadata;
113
+ otlpAdditionalHeaders: Record<string, string> | null;
114
+ readonly conf: LogConf;
115
+ readonly traceId: string;
116
+ readonly spanId: string;
117
+ constructor(conf?: LogConf | LogLevel | "none");
118
+ clone(conf?: LogConf | LogLevel | "none"): Log;
119
+ error(msg: string, metadata?: Metadata): void;
120
+ warn(msg: string, metadata?: Metadata): void;
121
+ info(msg: string, metadata?: Metadata): void;
122
+ verbose(msg: string, metadata?: Metadata): void;
123
+ debug(msg: string, metadata?: Metadata): void;
124
+ silly(msg: string, metadata?: Metadata): void;
125
+ end(): void;
126
+ private log;
127
+ private otlpCall;
128
+ private otlpCreateSpan;
129
+ }
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export const LogLevels={error:{otlpSeverityNumber:17,otlpSeverityText:"ERROR"},warn:{otlpSeverityNumber:13,otlpSeverityText:"WARN"},info:{otlpSeverityNumber:9,otlpSeverityText:"INFO"},verbose:{otlpSeverityNumber:8,otlpSeverityText:"DEBUG4"},debug:{otlpSeverityNumber:5,otlpSeverityText:"DEBUG"},silly:{otlpSeverityNumber:3,otlpSeverityText:"TRACE"}};export function msgJsonFormatter(conf){const payload=Object.assign(conf.metadata,{logLevel:conf.logLevel,msg:conf.msg,time:(new Date).toISOString()});return JSON.stringify(payload)}export function msgTextFormatter(conf){let levelOut="";if(conf.logLevel==="silly"){levelOut="sil"}else if(conf.logLevel==="debug"){levelOut="deb"}else if(conf.logLevel==="verbose"){levelOut="ver"}else if(conf.logLevel==="info"){levelOut="inf"}else if(conf.logLevel==="warn"){levelOut="war"}else if(conf.logLevel==="error"){levelOut="err"}else{throw new Error(`Invalid conf.logLevel: "${conf.logLevel}"`)}let str=`${(new Date).toISOString().substring(0,19)}Z [${levelOut}] ${conf.msg}`;const metadataStr=JSON.stringify(conf.metadata);if(metadataStr!=="{}"){str+=` ${JSON.stringify(conf.metadata)}`}return str}function generateSpanId(){const bytes=new Uint8Array(8);if(typeof crypto!=="undefined"&&crypto.getRandomValues){crypto.getRandomValues(bytes)}else{for(let i=0;i<8;i++){bytes[i]=Math.floor(Math.random()*256)}}bytes[0]|=1;return Array.from(bytes).map(byte=>byte.toString(16).padStart(2,"0")).join("")}function generateTraceId(){const bytes=new Uint8Array(16);if(typeof crypto!=="undefined"&&crypto.getRandomValues){crypto.getRandomValues(bytes)}else{for(let i=0;i<16;i++){bytes[i]=Math.floor(Math.random()*256)}}bytes[0]|=1;return Array.from(bytes).map(byte=>byte.toString(16).padStart(2,"0")).join("")}function getNsTimestamp(msTimestamp){const nanoseconds=msTimestamp*1e6;const fractionalNanoseconds=Math.floor(performance.now()%1*1e6);return nanoseconds+fractionalNanoseconds}function isFetchError(error){return typeof error==="object"&&error!==null&&"message"in error}export class Log{context;otlpAdditionalHeaders;#entryFormatter;#logLevel;#otlpHttpBaseURI;#parentLog;#printTraceInfo;#spanName;#stderr;#stdout;conf;traceId;spanId;#otlpSpanPayload;constructor(conf){if(conf===undefined){conf={}}else if(typeof conf==="string"){conf={logLevel:conf}}if(typeof conf.parentLog==="object"){for(const[key,value]of Object.entries(conf.parentLog.conf)){if(conf[key]===undefined){conf[key]=value}}}if(conf.logLevel===undefined){conf.logLevel="info"}if(conf.entryFormatter===undefined&&conf.format==="json"){conf.entryFormatter=msgJsonFormatter}else if(conf.entryFormatter===undefined){conf.entryFormatter=msgTextFormatter}if(conf.stderr===undefined){conf.stderr=console.error}if(conf.stdout===undefined){conf.stdout=console.log}this.#entryFormatter=conf.entryFormatter;this.#logLevel=conf.logLevel;this.#otlpHttpBaseURI=conf.otlpHttpBaseURI;this.#parentLog=typeof conf.parentLog==="object"?conf.parentLog:null;this.#printTraceInfo=conf.printTraceInfo===true?true:false;this.#stderr=conf.stderr;this.#stdout=conf.stdout;this.conf=conf;this.context=conf.context||{};this.otlpAdditionalHeaders=conf.otlpAdditionalHeaders;this.spanId=generateSpanId();this.traceId=generateTraceId();this.#spanName=conf.spanName||this.spanId;this.otlpCreateSpan()}clone(conf){if(conf===undefined){conf={}}else if(typeof conf==="string"){conf={logLevel:conf}}if(conf.logLevel===undefined){conf.logLevel=this.#logLevel}if(this.conf.format!=="json"&&conf.format==="json"){conf.entryFormatter=msgJsonFormatter}else{conf.entryFormatter=this.#entryFormatter}if(conf.stderr===undefined){conf.stderr=this.conf.stderr}if(conf.stdout===undefined){conf.stdout=this.conf.stdout}conf.context={...this.context,...conf.context};return new Log(conf)}error(msg,metadata){if(this.#logLevel==="none")return;this.log("error",msg,metadata)}warn(msg,metadata){if(["none","error"].includes(this.#logLevel))return;this.log("warn",msg,metadata)}info(msg,metadata){if(["none","error","warn"].includes(this.#logLevel))return;this.log("info",msg,metadata)}verbose(msg,metadata){if(["none","error","warn","info"].includes(this.#logLevel))return;this.log("verbose",msg,metadata)}debug(msg,metadata){if(["none","error","warn","info","verbose"].includes(this.#logLevel))return;this.log("debug",msg,metadata)}silly(msg,metadata){if(["none","error","warn","info","verbose","debug"].includes(this.#logLevel))return;this.log("silly",msg,metadata)}end(){this.#otlpSpanPayload.resourceSpans[0].scopeSpans[0].spans[0].endTimeUnixNano=String(getNsTimestamp(Date.now()));this.otlpCall({path:"/v1/traces",payload:this.#otlpSpanPayload})}log(logLevel,msg,metadata){const formattedMetadata=Object.assign(metadata||{},this.context);const msTimestamp=Date.now();if(this.#printTraceInfo){Object.assign(metadata,{spanId:this.spanId,traceId:this.traceId})}if(["error","warn"].includes(logLevel)){this.#stderr(this.#entryFormatter({logLevel:logLevel,metadata:formattedMetadata,msTimestamp:msTimestamp,msg:msg}))}else{this.#stdout(this.#entryFormatter({logLevel:logLevel,metadata:formattedMetadata,msTimestamp:msTimestamp,msg:msg}))}if(!this.#otlpHttpBaseURI){return}const payload={resourceLogs:[{resource:{attributes:[]},scopeLogs:[{logRecords:[{body:{stringValue:msg},severityNumber:LogLevels[logLevel].otlpSeverityNumber,severityText:LogLevels[logLevel].otlpSeverityText,timeUnixNano:String(getNsTimestamp(Date.now())),traceId:this.traceId}]}]}]};if(this.#parentLog!==null&&this.#parentLog.spanId){payload.resourceLogs[0].scopeLogs[0].logRecords[0].spanId=this.#parentLog.spanId;payload.resourceLogs[0].scopeLogs[0].logRecords[0].traceId=this.#parentLog.traceId}if(metadata&&Object.keys(metadata).length){payload.resourceLogs[0].scopeLogs[0].logRecords[0].attributes=[];for(const[key,value]of Object.entries(metadata)){payload.resourceLogs[0].scopeLogs[0].logRecords[0].attributes.push({key:key,value:{stringValue:value}})}}this.otlpCall({path:"/v1/logs",payload:payload})}async otlpCall({path,payload}){if(!this.#otlpHttpBaseURI){return true}const urlObj=new URL(this.#otlpHttpBaseURI);const url=`${urlObj.protocol}//${urlObj.username?`${urlObj.username}:${urlObj.password}@`:""}${urlObj.host}${path}`;const headers={"Content-Type":"application/json"};if(this.otlpAdditionalHeaders){Object.assign(headers,this.otlpAdditionalHeaders)}try{const res=await fetch(url,{body:JSON.stringify(payload),headers:headers,method:"POST"});if(!res.ok){const err=new Error("Non-ok return status");err.status=res.status;throw err}const resBody=await res.json();const resBodyStr=JSON.stringify(resBody);if(resBodyStr!=='{"partialSuccess":{}}'&&resBodyStr!=="{}"){throw new Error("Invalid response body from OTLP service. Expected '{\"partialSuccess\":{}}' or '{}' but got: '"+JSON.stringify(resBody)+"'")}return true}catch(err){if(isFetchError(err)){this.#stderr(this.#entryFormatter({logLevel:"error",metadata:{fetchStatus:String(err.status),url:url},msg:err.message}))}else if(err instanceof Error){this.#stderr(this.#entryFormatter({logLevel:"error",metadata:{url:url},msg:err.message}))}else{this.#stderr(this.#entryFormatter({logLevel:"error",metadata:{url:url},msg:"Unknown error sending to OTLP"}))}return false}}async otlpCreateSpan(){const msTimestamp=Date.now();const nsTimestamp=getNsTimestamp(msTimestamp);this.#otlpSpanPayload={resourceSpans:[{resource:{attributes:[]},scopeSpans:[{spans:[{endTimeUnixNano:String(nsTimestamp),kind:0,name:this.#spanName,spanId:this.spanId,startTimeUnixNano:String(nsTimestamp),traceId:this.traceId}]}]}]};if(Object.keys(this.context).length>0){this.#otlpSpanPayload.resourceSpans[0].scopeSpans[0].spans[0].attributes=[];for(const[key,value]of Object.entries(this.context)){this.#otlpSpanPayload.resourceSpans[0].scopeSpans[0].spans[0].attributes.push({key:key,value:{stringValue:String(value)}})}}if(this.#parentLog!==null&&this.#parentLog.spanId){this.#otlpSpanPayload.resourceSpans[0].scopeSpans[0].spans[0].parentSpanId=this.#parentLog.spanId}return this.otlpCall({path:"/v1/traces",payload:this.#otlpSpanPayload})}}
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,8BAA8B;IAC9B,KAAK,EAAE;QACN,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,OAAO;KACzB;IACD,IAAI,EAAE;QACL,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,MAAM;KACxB;IACD,IAAI,EA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