mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 03:34:14 +00:00
chore(logging): fix logging.error and make sure logger exists
This commit is contained in:
parent
4494600d92
commit
ae847facda
1 changed files with 8 additions and 4 deletions
|
|
@ -18,17 +18,21 @@ if (logger == null) {
|
|||
// A custom log function that wraps Winston. Makes it easy to instrument code
|
||||
// and still possible to replace Winston in the future.
|
||||
module.exports.log = function(/* variable args */) {
|
||||
logger.log.apply(logger, arguments);
|
||||
if (logger)
|
||||
logger.log.apply(logger, arguments);
|
||||
};
|
||||
|
||||
module.exports.info = function(/* variable args */) {
|
||||
logger.info.apply(logger, arguments);
|
||||
if (logger)
|
||||
logger.info.apply(logger, arguments);
|
||||
};
|
||||
|
||||
module.exports.warn = function(/* variable args */) {
|
||||
logger.warn.apply(logger, arguments);
|
||||
if (logger)
|
||||
logger.warn.apply(logger, arguments);
|
||||
};
|
||||
|
||||
module.exports.error = function(/* variable args */) {
|
||||
winston.error(arguments);
|
||||
if (logger)
|
||||
logger.error.apply(logger, arguments);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue