fix: Fix ts on logs

This commit is contained in:
Wanjohi
2025-10-26 00:06:07 +03:00
parent 815246afc0
commit f8f6aae64b

View File

@@ -4,6 +4,11 @@ import fs from "fs/promises";
import { Context } from "../context.js";
import { Global } from "../global/index.js";
type Tags = {
service: string;
[key: string]: any; // any other optional keys
};
export namespace Log {
const ctx = Context.create<{
tags: Record<string, any>;
@@ -102,8 +107,8 @@ export namespace Log {
}
let last = Date.now();
export function create(tags?: Record<string, any>) {
tags = tags || {};
export function create(tags: Tags) {
tags = tags || { service: "default" };
const service = tags["service"];
if (service && typeof service === "string") {