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
In this code which was derived from the example here, awriter gets moved into the Logger by add_writer.
Later I want to tell the awriter to reopen its output files, when SIGHUP is received but I could not find a way to do this.
Things I've tried:
LoggerHandle's reopen_outputfile() only considers the primary writer
and does not consider/handle writers added by add_writer if I read its source correctly.
I have not found any way to get access to the FileLogWriter again through the LoggerHandle.
I cannot pass an ArcLogFileWriter to add_writer, since it does not implement LogWriter.
So: How can I get the awriter to reopen its log file in a sighup handler?
fnhandle_sighup(lh:LoggerHandle) -> Result<(),Box<dyn std::error::Error>>{// somehow tell the logger to reopen the logfile of awriter here...// this does not print any logfiles, even though logging to the file works fine:eprintln!("logfiles: {:?}", lh.existing_log_files());// this does not work, it returns NoFileLogger error:
lh.reopen_outputfile()}
(Sorry, if I'm missing some obvious core rust thing that could be used here to keep a reference to awriter, I'm fairly new to rust.)
The text was updated successfully, but these errors were encountered:
In this code which was derived from the example here,
awriter
gets moved into the Logger by add_writer.Later I want to tell the
awriter
to reopen its output files, when SIGHUP is received but I could not find a way to do this.Things I've tried:
reopen_outputfile()
only considers the primary writerand does not consider/handle writers added by add_writer if I read its source correctly.
ArcLogFileWriter
to add_writer, since it does not implement LogWriter.So: How can I get the
awriter
to reopen its log file in a sighup handler?(Sorry, if I'm missing some obvious core rust thing that could be used here to keep a reference to
awriter
, I'm fairly new to rust.)The text was updated successfully, but these errors were encountered: