|
coastline 0.0.4
|
Forward SDL messages to a file and the previous callback until destruction. More...
#include <log.h>
Public Member Functions | |
| GameLog (const std::filesystem::path &path) | |
Open path, truncating an existing log. | |
| ~GameLog () | |
| Close the log file and restore the SDL callback active before construction. | |
| GameLog (const GameLog &)=delete | |
| Copying is disabled because this log registers a callback tied to its lifetime. | |
| GameLog & | operator= (const GameLog &)=delete |
| Assignment is disabled because callback restoration follows construction order. | |
| bool | IsOpen () const |
Friends | |
| void | StopGameLog () |
| Close the active game log and restore its previous callback before fatal process exit. | |
Forward SDL messages to a file and the previous callback until destruction.
Destroy nested instances in reverse construction order to restore callbacks correctly.
|
explicit |
Open path, truncating an existing log.
SDL messages still go to the previous callback when the file cannot be opened.
| path | The log file to create or truncate. |
| coastline::GameLog::~GameLog | ( | ) |
Close the log file and restore the SDL callback active before construction.
|
delete |
Copying is disabled because this log registers a callback tied to its lifetime.
Assignment is disabled because callback restoration follows construction order.
| bool coastline::GameLog::IsOpen | ( | ) | const |
|
friend |
Close the active game log and restore its previous callback before fatal process exit.