![]() |
NDEVR
API Documentation
|
Simply logs to a given connection. More...
Classes | |
| class | CommonMessageFormats |
| Common formats for sending messages over the pipe using setMessageSendFormat Default progress format is message_line. More... | |
| class | CommonProgressFormats |
| Common formats for sending messages over the pipe using setMessageProgressFormat Default progress format is percent. More... | |
Public Member Functions | |
| ConnectionPipeStream () | |
| Default constructor, no connection instance. | |
| ConnectionPipeStream (Connection *connection, bool open_connection) | |
| Sets the connection, if a connection is already set, removes that connection. | |
| ConnectionPipeStream (const ConnectionInfo &connection) | |
| Sets the connection, if a connection is already set, removes that connection. | |
| virtual void | addMessage (uint04 id, const LogMessage &message) override |
| Will send message across the network based on the given format parameters. | |
| bool | canSendMessages () const |
| Returns true if the connection exists and is ready to send. | |
| void | clearConnection () |
| Clears the connection. | |
| bool | setConnection (Connection *connection, bool open_connection) |
| Sets the connection, if a connection is already set, clears that connection (see clearConnection). | |
| bool | setConnection (const ConnectionInfo &connect_info) |
| Sets the connection, if a connection is already set, clears that connection (see clearConnection). | |
| void | setMessageSendFormat (const String &format) |
| Sets the message format where [message] will be replaced with the raw log message, and [time] will be replaced with a time string. | |
| virtual void | setProgress (uint04 id, fltp04 progress) override |
| Will send progress across the network based on the given format parameters. | |
| void | setProgressSendFormat (const String &format) |
| Sets the message format where [message] will be replaced with the raw log message, and [time] will be replaced with a time string. | |
| void | setTimeSendFormat (const String &format, bool use_local_time) |
| Sets the Time format for the time string (See https://ndevr.org/time-patterns/). | |
| Public Member Functions inherited from LogStream | |
| virtual | ~LogStream () |
| Destructor. | |
| virtual void | addMessages (uint04 id, const Buffer< LogMessage > &messages) |
| Adds multiple log messages to this stream at once. | |
| 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. | |
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. | |
| ConnectionPipeStream::ConnectionPipeStream | ( | Connection * | connection, |
| bool | open_connection ) |
Sets the connection, if a connection is already set, removes that connection.
| [in] | The | connection to send logs over. |
| [in] | Whether | or not to automatically open that connection |
| ConnectionPipeStream::ConnectionPipeStream | ( | const ConnectionInfo & | connection | ) |
Sets the connection, if a connection is already set, removes that connection.
|
overridevirtual |
Will send message across the network based on the given format parameters.
See setTimeSendFormat See setMessageSendFormat
Implements LogStream.
| void ConnectionPipeStream::clearConnection | ( | ) |
Clears the connection.
If class has ownership of the connection, will close and destroy the connection, otherwise simply unsets it.
| bool ConnectionPipeStream::setConnection | ( | Connection * | connection, |
| bool | open_connection ) |
Sets the connection, if a connection is already set, clears that connection (see clearConnection).
| [in] | The | connection to send logs over. |
| [in] | Whether | or not to automatically open that connection |
| bool ConnectionPipeStream::setConnection | ( | const ConnectionInfo & | connect_info | ) |
Sets the connection, if a connection is already set, clears that connection (see clearConnection).
Automatically opens the connection and takes ownership of it
| [in] | connect_info | The information to construct a connection. |
| void ConnectionPipeStream::setMessageSendFormat | ( | const String & | format | ) |
Sets the message format where [message] will be replaced with the raw log message, and [time] will be replaced with a time string.
| [in] | format | The format of the message Default: [message]\n |
| void ConnectionPipeStream::setProgressSendFormat | ( | const String & | format | ) |
Sets the message format where [message] will be replaced with the raw log message, and [time] will be replaced with a time string.
| [in] | format | The format of the message. |
| void ConnectionPipeStream::setTimeSendFormat | ( | const String & | format, |
| bool | use_local_time ) |
Sets the Time format for the time string (See https://ndevr.org/time-patterns/).
| [in] | format | The format of the string, Default: YYYY-MM-DD hh:mm:ss |
| [in] | use_local_time | whether or not to sent the time in UTC time (default) or local |