debugdi
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

debugdi

debug log package built for Inversify (dependency injection framework), automatically prefix your debug logs with the project name and class name

Example:

// package.json name "server"
// class TestService ...
debug.log('hello')

Logs (with DEBUG=server:*):

server:TestService hello

Install

yarn add debugdi

Usage

In your class inject the DebugLog class and call the log method, internally it's using the debug module so you need to enable the debug logs via the env variable DEBUG=<project name>:*

Example

export class TestService {
  constructor(@inject(DebugLog) private debug: DebugLog) {}

  myMethod(username: string) {
    this.debug.log(`hello ${username}`);
  }
}

// log output:
// <project name>:TestService hello <dynamic>

/debugdi/

    Package Sidebar

    Install

    npm i debugdi

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    6.61 kB

    Total Files

    9

    Last publish

    Collaborators

    • nya