You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Winston, unlike other logging libraries such as bunyan, lacks a .trace() method. This means that if I use a Winston with libraries that expect loggers to have .trace() methods, those libraries will fail. One simple work around is to simply add a .trace() function to the logger object that is equivalent to Winston's .silly() or .debug(). In Caproal, 1.X the entire problem could be resolved by adding the following 3 lines of code to your main entry file:
The above code gets the default logger object and then wires in the missing level. Unfortunately, no similar equivalent is possible in Caporal v 2.X as there is only a logger setter with no corresponding getter.
Describe the solution you'd like
Either
A: In Caproal v2, running program.logger() should return the current logger used by the program and not set the logger to undefined.
or
B: program has a new property logger which is the logger object used by the program.
Describe alternatives you've considered
Monkey patch the line logger.trace = logger.debug; to the beginning of every action function.
Additional context
Would you be able to work on it and provide a pull request ?
Yes
No
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Winston, unlike other logging libraries such as bunyan, lacks a
.trace()
method. This means that if I use a Winston with libraries that expect loggers to have.trace()
methods, those libraries will fail. One simple work around is to simply add a.trace()
function to the logger object that is equivalent to Winston's.silly()
or.debug()
. In Caproal, 1.X the entire problem could be resolved by adding the following 3 lines of code to your main entry file:The above code gets the default logger object and then wires in the missing level. Unfortunately, no similar equivalent is possible in Caporal v 2.X as there is only a logger setter with no corresponding getter.
Describe the solution you'd like
Either
program.logger()
should return the current logger used by the program and not set the logger to undefined.or
program
has a new propertylogger
which is the logger object used by the program.Describe alternatives you've considered
Monkey patch the line
logger.trace = logger.debug;
to the beginning of every action function.Additional context
Would you be able to work on it and provide a pull request ?
The text was updated successfully, but these errors were encountered: