Skip to content

Instantly share code, notes, and snippets.

@jmorrell
jmorrell / logger.js
Last active December 2, 2024 03:18
Logging
class Log {
constructor(name, attributes = new Map()) {
this.startTime = new Date().getTime();
this.startTimestampMs = performance.now();
this.name = name;
this.attributes = attributes;
}
setAttributes(keyValues) {
for (let [key, value] of Object.entries(keyValues)) {