@tverstraten/log-annotations
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

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
}

} `

Package Sidebar

Install

npm i @tverstraten/log-annotations

Weekly Downloads

0

Version

1.0.20

License

UNLICENSED

Unpacked Size

46 kB

Total Files

52

Last publish

Collaborators

  • tverstraten