Skip to content

LOGGER

@tsed/di

Usage

typescript
import { LOGGER } from "@tsed/di";

See /packages/di/src/common/services/DILogger.ts.

Overview

ts
const LOGGER: unique symbol;

export type LOGGER = DILogger;

Description

Injection token for the DI logger service.

Use this symbol to inject the configured logger instance into your services.

Usage

typescript
import {Injectable, Inject, LOGGER} from "@tsed/di";

@Injectable()
class MyService {
  @Inject(LOGGER)
  logger: LOGGER;

  doSomething() {
    this.logger.info("Doing something");
  }
}

Released under the MIT License.