Logger stream redirection
gregoryalary opened this issue · comments
I'm parsing a file that contains a custom ics field, which result in a lot of warning :
W, [2019-02-12T18:31:03.177185 #3709] WARN -- : No method "fbtype=" for component #<Icalendar::Event:0x000055ec739901f0>. Appending to custom.
W, [2019-02-12T18:31:03.177185 #3709] WARN -- : No method "fbtype=" for component #<Icalendar::Event:0x000055ec739901f0>. Appending to custom.
W, [2019-02-12T18:31:03.177185 #3709] WARN -- : No method "fbtype=" for component #<Icalendar::Event:0x000055ec739901f0>. Appending to custom.
...
I think that we should be able to choose the logger output stream in order, for example, to append the logs info to a file instead of just printing it.
Thank in advance!
I think this is already in place:
Icalendar.logger = Icalendar::Logger.new("file-to-redirect-to.log")
Or you can disable logging altogether by sending it to /dev/null
:
Icalendar.logger = Icalendar::Logger.new(File::NULL)
Thanks a lot!
I guess it should appear in the documentation/readme then.