Skip to content

Commit a8276c0

Browse files
authored
Merge pull request #5 from bufferapp/task/verbosity-level
Change LOG_LEVEL via environment variable
2 parents 22a93db + 4c9c62a commit a8276c0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
# js-bufflog
22
logger for all javascript and typescript Buffer services
3+
4+
5+
## Log verbosity levels
6+
7+
If you wish to see more logs, simply set the `LOG_LEVEL` to the desired level. Here a list with some use case:
8+
9+
| Levels | Use case | Examples |
10+
|:-:|---|---|
11+
| DEBUG | Logs that are used for interactive investigation during development. These logs should primarily contain information useful for debugging and have no long-term value. | |
12+
| INFO | Informational messages | |
13+
| NOTICE | Logs that track the general flow of the application. This is the default level | |
14+
| WARNING | Logs that highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop. | |
15+
| ERROR | Logs that highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure. | |
16+
| CRITICAL | Logs that describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention. | |

bufflog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import formats from "dd-trace/ext/formats";
33

44
export class BuffLog {
55
pinoLogger: any;
6-
defaultLevel = 'notice';
6+
defaultLevel = String.prototype.toLowerCase.apply(process.env.LOG_LEVEL) || "notice";;
77

88
constructor() {
99
this.pinoLogger = require('pino')({

0 commit comments

Comments
 (0)