Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/titarenko/wachter
https://github.com/titarenko/wachter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/titarenko/wachter
- Owner: titarenko
- Created: 2014-06-18T19:50:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-15T09:23:29.000Z (over 10 years ago)
- Last Synced: 2024-11-24T17:49:43.955Z (about 1 month ago)
- Language: JavaScript
- Size: 172 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wachter
Watchdog for your app. Provides API for logging and shutting down on certain condition.
Features:
* provides caller info (which function has called log method)
* colored console output
* logs uncaught exceptions (with `alert` level)
* provides methods to shut down app on uncaught exception or exceeding memory limit# API
Notice: if argument (except error) is object, it will be `JSON.stringify`ed, otherwise, `toString`ed.
## alert(arg, arg2, arg3, ..., error)
Logs `arg` and error details (if any) with level `alert` (highest level) to `stderr`.
## error(arg, arg2, arg3, ..., error)
Logs `arg` and error details (if any) with level `error` to `stderr`.
## info(arg, arg2, arg3, ...)
Logs `arg` with level `info` to `stdout`.
## debug(arg, arg2, arg3, ...)
Logs `arg` with level `debug` to `stdout`.
## exitWhenGotUncaughtException()
Shuts down app on uncaught exception.
## exitWhenExceededMemoryLimit(limit)
Shuts down app when it has consumed more than `limit` bytes.
## exit()
Shuts down app (with code 75 which means 'temporal failure').
# License
BSD