Skip to main content
This release is 7 versions behind 0.224.14 — the latest version of @std/log. Jump to latest

@std/log@0.224.7
Built and signed on GitHub Actions

UNSTABLE: A customizable logger framework

This package works with DenoIt is unknown whether this package works with Bun
This package works with Deno
It is unknown whether this package works with Bun
JSR Score
88%
Published
7 months ago (0.224.7)
Package root>error.ts
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. import { getLogger } from "./get_logger.ts"; import type { GenericFunction } from "./logger.ts"; /** Log with error level, using default logger. */ export function error<T>(msg: () => T, ...args: unknown[]): T | undefined; export function error<T>( msg: T extends GenericFunction ? never : T, ...args: unknown[] ): T; export function error<T>( msg: (T extends GenericFunction ? never : T) | (() => T), ...args: unknown[] ): T | undefined { // Assist TS compiler with pass-through generic type if (msg instanceof Function) { return getLogger("default").error(msg, ...args); } return getLogger("default").error(msg, ...args); }