-
Notifications
You must be signed in to change notification settings - Fork 104
Added support for custom logger functions #6
Conversation
Adds the ability to pass a custom logging function as an option. The default is still console.log()
Great work with everything, ill look over today 👍
|
Using winston is definitely a good idea, I wouldn't be against making it be a requirement in fact... |
@@ -376,6 +380,11 @@ var CDN = function(app, options) { | |||
throwError('missing option "' + options[index] + '"'); | |||
}); | |||
|
|||
if(options.logger) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be nit picky... but I will anyway :P
if (options.logger) {
would match the format used in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, you're right. The shame!
Though really we should work on making the whole code more modular, i've another bug to solve involving timestamps in filenames and the code is a little confusing at present.
I'll manually fix the format per @mathrawka suggestion \o Excited to use loggly/winston together with this! |
Added support for custom logger functions
Moved the hashed filename creation after the CSS is transformed/replaced
Adds the ability to pass a custom logging function as an option.
The default is still console.log()
I use the excellent winston library to manage logs, so in this case I would pass my winston log function to express-cdn: