bux API Reference 1.9.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
|
#include <FileLog.h>
Public Member Functions | |
C_PathFmtLogSnap (const std::chrono::time_zone *tz) | |
C_PathFmtLogSnap (bool use_local_time=true) | |
C_PathFmtLogSnap & | configPath (const std::string &pathFmt) |
C_PathFmtLogSnap & | configPath (uintmax_t fsize_in_bytes, const auto &fallbackPaths) |
C_PathFmtLogSnap & | enableAutoMkDir (bool yes=true) |
C_PathFmtLogSnap & | setBinaryMode (bool enabled) |
std::ostream * | snap () override |
Snap the current T value. | |
Public Member Functions inherited from bux::I_SnapT< std::ostream * > | |
virtual | ~I_SnapT ()=default |
Pointer deletion is hereby granted. | |
Configurable to automatically change the output path according to the current timestamp.
|
explicit |
Definition at line 11 of file FileLog.cpp.
References configPath().
|
inlineexplicit |
C_PathFmtLogSnap & bux::C_PathFmtLogSnap::configPath | ( | const std::string & | _pathFmt | ) |
[in] | _pathFmt | Used as fmt parameter of std::vformat() with one single extra argument to format, ie. timestamp for now. |
*this
Each formatted path is the target file for the moment when something is to be logged on demand.
Definition at line 16 of file FileLog.cpp.
References RUNTIME_ERROR.
Referenced by C_PathFmtLogSnap().
|
inline |
[in] | fsize_in_bytes | Max bytes per log file. |
[in] | fallbackPaths | Array of strings used in turn as fmt parameter of std::vformat() with one single extra argument to format, ie. timestamp for now. |
*this
Each formatted path is the target file for the moment when something is to be logged on demand.
C_PathFmtLogSnap & bux::C_PathFmtLogSnap::enableAutoMkDir | ( | bool | yes = true | ) |
[in] | yes | Whether or not to create subdirectory for the openning log path. The default is true. |
*this
If enabled, missing subdirs are always created before opening the log file no matter how deep the subdir is.
Definition at line 33 of file FileLog.cpp.
C_PathFmtLogSnap & bux::C_PathFmtLogSnap::setBinaryMode | ( | bool | enabled | ) |
[in] | enabled | Whether or not to open log files in binary mode. The default is false. |
*this
Definition at line 44 of file FileLog.cpp.
|
overridevirtual |
Snap the current T value.
Implements bux::I_SnapT< std::ostream * >.
Definition at line 57 of file FileLog.cpp.
References RUNTIME_ERROR.