kitten-logger
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -0,1 +1,5 @@ | ||
## v0.2.2 | ||
*2022-11-28* | ||
- Add an env var `KITTEN_LOGGER_DEST` to choose the destination. | ||
## v0.2.1 | ||
@@ -2,0 +6,0 @@ *2022-09-01* |
{ | ||
"name": "kitten-logger", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -51,2 +51,5 @@ # kitten-logger | ||
`KITTEN_LOGGER_IS_LOADED` | If `true`, kitten-logger will prefix all logs by `K_LOG` for sub instances of kitten-logger. | ||
`KITTEN_LOGGER_DEST` | If `auto`, kitten-logger will write logs to the terminal if the process `process.stdout.fd` is a TTY if not, kitten-logger will write logs to the `out.log` file | ||
| If `tty`, kitten-logger will write logs to the terminal | ||
| If `file`, kitten-logger will write logs to the `out.log` file | ||
@@ -53,0 +56,0 @@ ### Initialisation `kittenLogger.init` |
@@ -15,2 +15,6 @@ const cluster = require('cluster'); | ||
function isTTYMode () { | ||
return process.env.KITTEN_LOGGER_DEST === 'tty' || (tty.isatty(process.stdout.fd) && (process.env.KITTEN_LOGGER_DEST === 'auto' || !process.env.KITTEN_LOGGER_DEST)); | ||
} | ||
module.exports = { | ||
@@ -38,5 +42,5 @@ getTime () { | ||
isTTY : tty.isatty(process.stdout.fd), | ||
isTTY : isTTYMode(), | ||
KITTEN_LOGGER_TAG : 'K_LOG' | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32817
796
204
20