richardgirges / express-fileupload

Simple express file upload middleware that wraps around busboy
MIT License
1.52k stars 259 forks source link

Feat: Custom logger #371

Closed RobinTail closed 4 months ago

RobinTail commented 4 months ago

I'm using express-fileupload for an application having more advanced loggers than Console. I'd like to suggest the feature that enables consumers to configure the logger while preserving the console by default.

coveralls commented 4 months ago

Coverage Status

coverage: 94.362%. remained the same when pulling cb317f7856cbffec4faae084eb2977cb0dc53b9e on RobinTail:feat-custom-logger into 98028e91d11b368df53ada2a183ecd863737baa4 on richardgirges:master.

RobinTail commented 4 months ago

@richardgirges , please review

RomanBurunkov commented 4 months ago

Hi @RobinTail

Thank u for this PR. Just one suggestion: What if you add console to the defaults, and remove OR in logging function. If it's ok, I will be happy to merge and publish it.

RobinTail commented 4 months ago

I can do that, but it will also require me to update some existing tests of debugLog() utility, @RomanBurunkov I will let you know once it's done.

RobinTail commented 4 months ago

Done, @RomanBurunkov . I made logger option to be console by default and removed OR from debugLog(). Instead, I added an additional check for the presence of the logger property, because of the tests that call that method directly. Those I updated as well.

RobinTail commented 4 months ago

@RomanBurunkov , please review again.

RobinTail commented 4 months ago

Thank you @RomanBurunkov . Could you release it as 1.5.0 so I could make another PR to @types/express-fileupload for describing these changes?

RobinTail commented 4 months ago

Types updating PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69016 FYI, @RomanBurunkov