# Logger

`class` in `logger` · v0.6.1

<https://seedcord.org/docs/packages/logger/0.6.1/classes/logger>

Channel-aware logging service.

Builds a plain LogRecord per call and dispatches it to the process-global
[`LoggerChannelRegistry`](/docs/packages/logger/0.6.1/classes/logger-channel-registry). No transport is bound, so it runs on a gateway server and a
Cloudflare Worker without changes.

```ts
class Logger implements ILogger
```

## Constructors

### constructor

```ts
Logger(label: string, options?: LoggerOptions)
```

Constructs a new instance of the `Logger` class

## Properties

### utils

```ts
public readonly utils: LoggerUtilities
```

## Methods

### configure

```ts
public static configure(config: LoggerConfig): void
```

Full-replaces the global logger configuration.

### debug

```ts
public debug(
    msg: string,
    args: unknown[]
): void
```

### error

```ts
public error(
    msg: string,
    args: unknown[]
): void
```

### info

```ts
public info(
    msg: string,
    args: unknown[]
): void
```

### setChannel

```ts
public setChannel(channel: LoggerChannelId): void
```

Switches this logger to a different channel.

### trace

```ts
public trace(
    msg: string,
    args: unknown[]
): void
```

### warn

```ts
public warn(
    msg: string,
    args: unknown[]
): void
```

### withChannel

```ts
public withChannel(channel: LoggerChannelId): Logger
```

Returns a new logger for this label on the given channel.

### withLabel

```ts
public withLabel(label: string): Logger
```

Returns a new logger on this channel with the given label.
