![]() |
NDEVR
API Documentation
|
A LogStream that writes log messages directly to a specified ASCII text file. More...
Public Member Functions | |
| AsciiFileOutputStream (const File &file, bool append) | |
| Constructs an AsciiFileOutputStream targeting the given file. | |
| virtual | ~AsciiFileOutputStream () |
| Destructor. | |
| void | addMessage (uint04 id, const LogMessage &message) final override |
| Adds a single log message to the output file. | |
| void | addMessages (uint04 id, const Buffer< LogMessage > &messages) final override |
| Adds multiple log messages to the output file in a batch. | |
| void | copyFile (File new_location) |
| Copies the current log file to a new location on disk. | |
| const File & | file () const |
| Returns a reference to the current output file. | |
| void | moveFile (File new_location) |
| Moves the current log file to a new location on disk. | |
| void | setFile (const File &file, bool append) |
| Changes the target output file. | |
| void | setOnlyLogSession (bool only_log_session) |
| Sets whether only messages from the current session should be logged. | |
| void | setProgress (uint04, fltp04) final override |
| Sets progress information. | |
| Public Member Functions inherited from LogStream | |
| virtual | ~LogStream () |
| Destructor. | |
| virtual void | addProgressSource (const TranslatedString &name, uint04 idx, fltp04 progress) |
| Registers a new progress source to be tracked by this stream. | |
| virtual void | allowCancel (bool) |
| Sets whether this stream allows the user to cancel an in-progress operation. | |
| virtual void | allowInput (bool) |
| Sets whether this stream allows user input during an operation. | |
| virtual void | attach (InfoPipe *stream) |
| Attaches this LogStream to the given InfoPipe so it receives log updates. | |
| void | clearLinks () |
| Detaches this LogStream from all linked InfoPipe objects and clears the link list. | |
| virtual void | detach (InfoPipe *stream) |
| Detaches this LogStream from the given InfoPipe, stopping further updates from it. | |
| bool | ignoringMessages () const |
| Returns whether this stream is currently ignoring messages. | |
| virtual void | removeProgressSource (uint04 idx) |
| Removes a previously registered progress source from this stream. | |
| void | setIgnoreMessages (bool ignore) |
| Sets whether this stream should ignore incoming messages. | |
Static Public Member Functions | |
| static void | ReadLogFile (LogPtr stream, const File &file) |
| Reads log messages from an ascii file into a log stream. | |
| static void | WriteLogFile (LogPtr stream, const File &file) |
| Writes all messages from a log stream to an ascii file. | |
Additional Inherited Members | |
| Protected Attributes inherited from LogStream | |
| bool | m_ignore_message = false |
| Whether this stream should ignore incoming messages. | |
| Buffer< InfoPipe * > | m_linked_logs |
| Collection of InfoPipe objects this stream is listening to. | |
| Dictionary< uint04, ProgressSource > | m_progress_sources |
| Maps progress source indices to their ProgressSource data. | |
A LogStream that writes log messages directly to a specified ASCII text file.
Definition at line 44 of file AsciiFileOutputStream.h.
|
explicit |
Constructs an AsciiFileOutputStream targeting the given file.
| [in] | file | The file to write log messages to. |
| [in] | append | Whether to append to the existing file contents or overwrite. |
References file().
|
virtual |
Destructor.
Flushes remaining messages and releases resources.
|
finaloverridevirtual |
Adds a single log message to the output file.
| [in] | id | The message identifier. |
| [in] | message | The log message to write. |
Implements LogStream.
|
finaloverridevirtual |
Adds multiple log messages to the output file in a batch.
| [in] | id | The starting message identifier. |
| [in] | messages | The buffer of log messages to write. |
Reimplemented from LogStream.
| void AsciiFileOutputStream::copyFile | ( | File | new_location | ) |
Copies the current log file to a new location on disk.
| [in] | new_location | The destination file path. |
| const File & AsciiFileOutputStream::file | ( | ) | const |
Returns a reference to the current output file.
Referenced by AsciiFileOutputStream(), ReadLogFile(), setFile(), and WriteLogFile().
| void AsciiFileOutputStream::moveFile | ( | File | new_location | ) |
Moves the current log file to a new location on disk.
| [in] | new_location | The destination file path. |
| void AsciiFileOutputStream::setFile | ( | const File & | file, |
| bool | append ) |
| void AsciiFileOutputStream::setOnlyLogSession | ( | bool | only_log_session | ) |
Sets whether only messages from the current session should be logged.
| [in] | only_log_session | If true, only current session messages are written. |
Sets progress information.
No-op for this stream.
| [in] | id | The progress identifier. |
| [in] | progress | The progress value between 0 and 1. |
Implements LogStream.
Definition at line 62 of file AsciiFileOutputStream.h.