Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dot-build/logger
Tiny logger utility for Node.JS and web apps
https://github.com/dot-build/logger
Last synced: about 1 month ago
JSON representation
Tiny logger utility for Node.JS and web apps
- Host: GitHub
- URL: https://github.com/dot-build/logger
- Owner: dot-build
- Created: 2015-12-25T17:57:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T11:45:11.000Z (almost 7 years ago)
- Last Synced: 2024-05-22T16:09:30.569Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 120 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @dotbuild/logger
Tiny logger utility for Node.JS and web apps
## Usage
```js
import { Logger, LogLevel } from '@dot-build/logger'
const logger = new Logger('any-name');logger.info('Unicorns are real');
// output to `console.log`: Unicorns are real
// Optional. Can be None, Error, Warning, Info, Log, Debug
Logger.setLevel(LogLevel.Info);
```## Using a different log output
Implement LogOutput interface:
```js
import { Logger, LogOutput } from '@dot-build/logger';class CustomOutput implements LogOutput {
log(...args) {
// do something with arguments
}
}Logger.setOutput(new CustomOutput());
```