Loading...
Searching...
No Matches
Mirror stdout and stderr into one session file for a scoped run.
More...
#include <application_runtime.h>
|
| | SessionLog (const fs::path &directory, const fs::path &filename="pangea.log") |
| | Open an append-only session log and install console mirroring.
|
| | ~SessionLog () |
| | Detach the tee buffers before their file and lock are destroyed.
|
Mirror stdout and stderr into one session file for a scoped run.
Construction installs the tee buffers and destruction restores the streams that were active before the session. Keep this object alive for the whole operation so worker diagnostics cannot outlive the file stream.
Definition at line 96 of file application_runtime.h.
◆ SessionLog()
| SessionLog::SessionLog |
( |
const fs::path & | directory, |
|
|
const fs::path & | filename = "pangea.log" ) |
|
inlineexplicit |
Open an append-only session log and install console mirroring.
- Parameters
-
| [in] | directory | Existing working directory for the session. |
| [in] | filename | Log name relative to directory. |
- Exceptions
-
| std::runtime_error | If the log cannot be opened. |
Definition at line 110 of file application_runtime.h.
◆ ~SessionLog()
| SessionLog::~SessionLog |
( |
| ) |
|
|
inline |
Detach the tee buffers before their file and lock are destroyed.
Workers must already be stopped before restoring global streams.
Definition at line 121 of file application_runtime.h.
◆ errors_
◆ file_
| std::ofstream SessionLog::file_ |
|
private |
◆ mutex_
| std::mutex SessionLog::mutex_ |
|
private |
◆ oldErrors_
| std::streambuf* SessionLog::oldErrors_ |
|
private |
◆ oldOutput_
| std::streambuf* SessionLog::oldOutput_ |
|
private |
◆ output_
The documentation for this class was generated from the following file: