fmtlog icon indicating copy to clipboard operation
fmtlog copied to clipboard

How do I log to multiple files from fmtlog. I want to write different messages to different files.

Open alphanso opened this issue 2 years ago • 4 comments

alphanso avatar Mar 15 '22 07:03 alphanso

Currently it's not supported. But you can register log handler callback to handle it yourself.

MengRao avatar Mar 15 '22 09:03 MengRao

I believe I will need to do that in background thread. Please share an example for writing in 2 different files .

alphanso avatar Mar 16 '22 02:03 alphanso

The registered callback is indeed called in background thread. You can refer to logcb in https://github.com/MengRao/fmtlog/blob/main/test/log_test.cc, which simply prints the log msg to stdout.

MengRao avatar Mar 16 '22 02:03 MengRao

Thanks. I will give this a try. It will be great if we can add this feature.

alphanso avatar Mar 16 '22 08:03 alphanso