You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to write logs to a file? It would be nice if there was a way to both log to console/terminal and write to a .txt file to view output logs of long-running operations at a later point in time.
The text was updated successfully, but these errors were encountered:
It's not possible at the moment.
However it shouldn't be that hard to implement given the fact that the formatter already has a flag to exclude colors from the generated logs if needed. Those could then be piped out into a file if, say, the "to-file" feature is enabled or something similar.
Suggestion
I will unfortunately not be able to sit with this for a few weeks, however, if you'd like to give it a try I would suggest you start by looking at the stdout method of the logger in src/logger/mod.rs.
If the feature is enabled, you would run format_string (in src/formatter/mod.rs) with the second parameter as false in order to remove all the color keys from the string and dump the line into a file of your choosing.
Maybe you can try simplelog, which has different types of loggers (see readme, TermLogger, WriteLogger) and does implement paris as a feature for beatiful ouput.
Is it possible to write logs to a file? It would be nice if there was a way to both log to console/terminal and write to a .txt file to view output logs of long-running operations at a later point in time.
The text was updated successfully, but these errors were encountered: