File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,6 @@ const TransportStream = require('winston-transport');
1818 * @extends {TransportStream }
1919 */
2020module . exports = class Console extends TransportStream {
21- // Keep a reference to the log, warn, and error console methods
22- // in case they get redirected to this transport after the logger is
23- // instantiated. This prevents a circular reference issue.
24- _consoleLog = console . log . bind ( console ) ;
25- _consoleWarn = console . warn . bind ( console ) ;
26- _consoleError = console . error . bind ( console ) ;
27-
2821 /**
2922 * Constructor function for the Console transport object responsible for
3023 * persisting log messages and metadata to a terminal or TTY.
@@ -40,6 +33,13 @@ module.exports = class Console extends TransportStream {
4033 this . eol = typeof options . eol === 'string' ? options . eol : os . EOL ;
4134 this . forceConsole = options . forceConsole || false ;
4235
36+ // Keep a reference to the log, warn, and error console methods
37+ // in case they get redirected to this transport after the logger is
38+ // instantiated. This prevents a circular reference issue.
39+ this . _consoleLog = console . log . bind ( console ) ;
40+ this . _consoleWarn = console . warn . bind ( console ) ;
41+ this . _consoleError = console . error . bind ( console ) ;
42+
4343 this . setMaxListeners ( 30 ) ;
4444 }
4545
You can’t perform that action at this time.
0 commit comments