1 #ifndef FILE_LOGGER_CLASS
2 #define FILE_LOGGER_CLASS
87 int limit()
const {
return int(_file_limit); }
89 void limit(
int new_limit) { _file_limit = new_limit; }
111 int size_reduction()
const;
130 #define SETUP_FILE_LOGGER { \
131 loggers::standard_log_base *old_log = loggers::program_wide_logger::set \
132 (new loggers::file_logger(loggers::file_logger::log_file_for_app_name())); \
Provides a dynamically resizable ASCII character string.
Defines the base class for all string processing objects in hoople.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
Provides file managment services using the standard I/O support.
bool reopen()
closes the current file and attempts to reopen it.
bool good() const
returns true if the logger appears correctly hooked up to a file.
@ DEFAULT_LOG_FILE_SIZE
this just defines the default for the log file size.
basis::astring name() const
observes the filename where logged information is written.
void flush()
causes any pending writes to be sent to the output file.
static basis::astring log_file_for_app_name()
returns a log file name for file_logger based on the program name.
void truncate(size_t new_size)
chops the file to ensure it doesn't go much over the file size limit.
DEFINE_CLASS_NAME("file_logger")
file_logger()
creates a logger without a log file and with the default size limit.
void limit(int new_limit)
modifies the allowable size of the log file.
basis::outcome log(const basis::base_string &info, int filter=basis::ALWAYS_PRINT)
writes information to the log file (if the filename is valid).
basis::outcome format_bytes(const basis::byte_array &to_log, int filter=basis::ALWAYS_PRINT)
fancifully formats a stream of bytes "to_log" and sends them into log.
basis::outcome log_bytes(const basis::byte_array &to_log, int filter=basis::ALWAYS_PRINT)
sends a stream of bytes "to_log" without interpretation into the log.
int limit() const
observes the allowable size of the log file.
A base class for a very usable logger with a filter_set and eol awareness.
A logger that sends to the console screen using the standard output device.