diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-06-14 01:21:11 +0800 | 
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-06-14 02:35:01 +0800 | 
| commit | 8fe85fccf3881114202301ac986073564d5abd3f (patch) | |
| tree | fc58511731fd77296e3f1df54478bb0208e5fcc5 /deno/base | |
| parent | 42526fed6f86a3a3a352313078668fcc8b473a3b (diff) | |
| download | crupest-8fe85fccf3881114202301ac986073564d5abd3f.tar.gz crupest-8fe85fccf3881114202301ac986073564d5abd3f.tar.bz2 crupest-8fe85fccf3881114202301ac986073564d5abd3f.zip  | |
deno(mail-server): drop custom logger, use builtin console.
Diffstat (limited to 'deno/base')
| -rw-r--r-- | deno/base/log.ts | 41 | 
1 files changed, 0 insertions, 41 deletions
diff --git a/deno/base/log.ts b/deno/base/log.ts index cc71dfa..403b9ce 100644 --- a/deno/base/log.ts +++ b/deno/base/log.ts @@ -2,19 +2,11 @@ import { join } from "@std/path";  import { toFileNameString } from "./date.ts"; -export type LogLevel = "error" | "warn" | "info"; - -export interface LogOptions { -  level?: LogLevel; -  cause?: unknown; -} -  export interface ExternalLogStream extends Disposable {    stream: WritableStream;  }  export class Logger { -  #defaultLevel = "info" as const;    #externalLogDir?: string;    get externalLogDir() { @@ -30,39 +22,6 @@ export class Logger {      }    } -  write(message: string, options?: LogOptions): void { -    const logFunction = console[options?.level ?? this.#defaultLevel]; -    if (options?.cause != null) { -      logFunction.call(console, message, options.cause); -    } else { -      logFunction.call(console, message); -    } -  } - -  info(message: string) { -    this.write(message, { level: "info" }); -  } - -  tagInfo(tag: string, message: string) { -    this.info(tag + " " + message); -  } - -  warn(message: string) { -    this.write(message, { level: "warn" }); -  } - -  tagWarn(tag: string, message: string) { -    this.warn(tag + " " + message); -  } - -  error(message: string, cause?: unknown) { -    this.write(message, { level: "info", cause }); -  } - -  tagError(tag: string, message: string, cause?: unknown) { -    this.error(tag + " " + message, cause); -  } -    async createExternalLogStream(      name: string,      options?: {  | 
