Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/powerlog/lib/Powerlog.ts>default

A powerful logger for Deno.
Latest
class default
import { default } from "https://deno.land/x/powerlog@0.1.0/lib/Powerlog.ts";

Constructors

new
default(options: TPowerlogOperions<Levels>)

Avoid using this method yourself, this will not add typings to the level methods created by Powerlog.

Properties

readonly
name: string

The name of this logger.

readonly
onerror: Event<[Error]>

Emitted when an error occurs.

Methods

private
_push(
level: number,
message: string,
args: unknown[],
): this

Push each transport into the log queue.

dispose(): Promise<void>

Call dispose on the transports on this instance.

format(): TFormatter | undefined

Get the default formatter.

format(formatter: TFormatter): this

Set the default formatter.

format(formatter?: TFormatter): this | TFormatter | undefined

Set/get the default formatter.

unsuse(...transports: ITransport<Levels>[])

Remove transports from this instance.

Note that this will also dispose of the transports.

use(...transports: ITransport<Levels>[])

Add an initialize transports to this instance.

Static Methods

get<Levels>(options: TPowerlogOperions<Levels>): Powerlog<Levels> & TLevelMethods<Levels>

This is a static method used to create a new Powerlog instance. It is most recommended to use this method instead of initiating a new instance of Powerlog yourself. This is because the powerlog instance adds some extra function properties to itself that aren't typed. Using Powerlog.get(options) those function properties will be typed.