Since @hv0905 mentioned that console.log is really a nice way for developers to diagnostic issues. I suggest that we can write it more to allow debugging in our staging env.
While when we are doing this approach, I don't suggest to write the following code everywhere:
if (isStaging) {
console.log('some debug details');
}
What do you suggest us to do?
Since @hv0905 mentioned that
console.log
is really a nice way for developers to diagnostic issues. I suggest that we can write it more to allow debugging in our staging env.While when we are doing this approach, I don't suggest to write the following code everywhere:
But instead, we gonna create a log service.
And implement it with different ways. Like:
And use
ConsoleLogger
in staging env andDummyLogger
in prod env.