Usage
import { logger } from 'nr1'
API methods
logger.debug
function () => undefined
logger.deprecate
function (message: string Deprecation message.
) => undefined
logger.error
function (message: string, JavaScript string containing zero or more
substitution strings. To print the percentage sign, use double
encoding (%%
).
...params: Object[] JavaScript objects with which to replace
substitution strings within message
. This gives you additional
control over the format of the output.
) => undefined
Example 1
1const state = { foo: 42, bar: 'token' };2
3logger.error('Invalid state passed: %O', state);
logger.log
function (message: string, JavaScript string containing zero or more
substitution strings. To print the percentage sign, use double
encoding (%%
).
...params: Object[] JavaScript objects with which to replace
substitution strings within message
. This gives you additional
control over the format of the output.
) => undefined
Example 1
1logger.log('Hello, my name is %s', 'John Doe');
logger.silent
function (message: string, JavaScript string containing zero or more
substitution strings. To print the percentage sign, use double
encoding (%%
).
...params: Object[] JavaScript objects with which to replace
substitution strings within message
. This gives you additional
control over the format of the output.
) => undefined
Example 1
1logger.silent('called method %s with arguments %O', 'foo', args);
logger.warn
function (message: string, JavaScript string containing zero or more
substitution strings. To print the percentage sign, use double
encoding (%%
).
...params: Object[] JavaScript objects with which to replace
substitution strings within message
. This gives you additional
control over the format of the output.
) => undefined
Example 1
1logger.warn('Threshold exceeded by %d%%!', 35);