mirror of
https://github.com/nestriness/nestri.git
synced 2026-08-02 01:35:18 +03:00
fix: Fix ts on logs
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user