1.0.20 • Published 1 year ago

@tverstraten/log-annotations v1.0.20

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

Logging

Simple wrappers for console logging that adds annotation based logging with some extended configuration. It can log method entry, exit and failure (exception) automatically including parameter and return value output.

Configuration

See Logging.ts for how to configre. Essentialy set process.env.LOG_LEVELS for set a logging level for the named logger(s) and/or set process.env.LOG_LEVEL for the default level.

Usage

` class MyClass { // Log annotations requires an accessible member called "logger" private logger = Logging.newLogger(MyClass.name)

@LogAsyncMethod()
async myFunction(): void {
    // do something
}

@LogMethod([LogAction.entry, LogAction.exception])
myFunction(): void {
    // do something
}

} `