Open marchaos opened 8 months ago
Hello, the interface PinoRotatingFileStreamOptions
extends the Options
interface defined in the rotating-file-stream
package.
It should be defined here: https://github.com/iccicci/rotating-file-stream/blob/master/index.ts#L55
Since the values you are referring to are optional I think you can manually set them to undefined
/none
.
I haven't tested it out, so please let me know if it works.
I'm also running into this problem with (Sorry compress: false
which doesn't work due to the defaults.compress
is a bad example since false
isn't supported by rotating
file-stream`)
Hello, the interface
PinoRotatingFileStreamOptions
extends theOptions
interface defined in therotating-file-stream
package. It should be defined here: https://github.com/iccicci/rotating-file-stream/blob/master/index.ts#L55Since the values you are referring to are optional I think you can manually set them to
undefined
/none
. I haven't tested it out, so please let me know if it works.
This doesn't work because the defaults are using ||
which means a falsy value of undefined
or false
will all fallback to the specified defaults
For example
// assume interval = undefined
undefined || '7d'
// '7d'
Sorry actually looking at the rotating-file-stream
library, it looks like they actually don't accept undefined
for a lot of values, including interval
Error: Don't know how to handle 'options.interval' type: undefined
at Object.interval (C:\Users\longz\Documents\GitHub\pino-rotating-file-stream\node_modules\rotating-file-stream\dist\cjs\index.js:438:19)
at checkOpts (C:\Users\longz\Documents\GitHub\pino-rotating-file-stream\node_modules\rotating-file-stream\dist\cjs\index.js:535:20)
at createStream (C:\Users\longz\Documents\GitHub\pino-rotating-file-stream\node_modules\rotating-file-stream\dist\cjs\index.js:579:18)
I'm not sure why they made the type optional
but then don't actually support undefined
With that in mind then, I guess this library always setting some defaults even for falsy values makes sense.
Hey. In https://github.com/thelicato/pino-rotating-file-stream/blob/main/src/index.ts you set some default values, but in my case I don't want to have an interval, but with those I cannot set it to undefined.
Are you able to remove those default values so that those can be undefined?