49
loading...
This website collects cookies to deliver better user experience
console
is disallowed by tslint by default. And for good reason. Console logging is a mess most of the time. If you can just willy-nilly console.log(whatever)
then your logs are pretty much useless.Logger.(debug|info|warn|error|devOnly|techDebt)(module: string, method: string, message?: any)
debug|info|warn|error
will log in all environments unless you also set the optional devOnly: boolean
argument to true
. Then the module
and method
will still log, but not the message
argument. This allows for tracing without leaking sensitive data in a production environment.devOnly|techDebt
do not have the optional devOnly
argument and will only ever log to the console in a non-production environment.src/environments/environment.ts
’s production
property value. If it’s false you’ll get all log statements. If it’s true you’ll only get debug|info|warn|error
."Log All The Things": {
"prefix": "ll",
"body": [
"Logger.${LEVEL}('${CLASS}', '${METHOD}', `${message}`);"
]
}