Fawkes API
Fawkes Development Version
|
#include <>>
Classes | |
struct | network_logger_header_t |
Network logging message header. More... | |
Public Types | |
enum | network_logger_msgtype_t { MSGTYPE_SUBSCRIBE = 1, MSGTYPE_UNSUBSCRIBE = 2, MSGTYPE_LOGMESSAGE = 3 } |
NetworkLogger message types. More... | |
![]() | |
enum | LogLevel { LL_DEBUG = 0, LL_INFO = 1, LL_WARN = 2, LL_ERROR = 4, LL_NONE = 8 } |
Log level. More... | |
Public Member Functions | |
NetworkLogger (FawkesNetworkHub *hub, LogLevel log_level=LL_DEBUG) | |
Constructor. More... | |
virtual | ~NetworkLogger () |
Destructor. More... | |
virtual void | log_debug (const char *component, const char *format,...) |
virtual void | log_info (const char *component, const char *format,...) |
virtual void | log_warn (const char *component, const char *format,...) |
virtual void | log_error (const char *component, const char *format,...) |
virtual void | log_debug (const char *component, Exception &e) |
virtual void | log_info (const char *component, Exception &e) |
virtual void | log_warn (const char *component, Exception &e) |
virtual void | log_error (const char *component, Exception &e) |
virtual void | vlog_debug (const char *component, const char *format, va_list va) |
virtual void | vlog_info (const char *component, const char *format, va_list va) |
virtual void | vlog_warn (const char *component, const char *format, va_list va) |
virtual void | vlog_error (const char *component, const char *format, va_list va) |
virtual void | tlog_debug (struct timeval *t, const char *component, const char *format,...) |
virtual void | tlog_info (struct timeval *t, const char *component, const char *format,...) |
virtual void | tlog_warn (struct timeval *t, const char *component, const char *format,...) |
virtual void | tlog_error (struct timeval *t, const char *component, const char *format,...) |
virtual void | tlog_debug (struct timeval *t, const char *component, Exception &e) |
virtual void | tlog_info (struct timeval *t, const char *component, Exception &e) |
virtual void | tlog_warn (struct timeval *t, const char *component, Exception &e) |
virtual void | tlog_error (struct timeval *t, const char *component, Exception &e) |
virtual void | vtlog_debug (struct timeval *t, const char *component, const char *format, va_list va) |
virtual void | vtlog_info (struct timeval *t, const char *component, const char *format, va_list va) |
virtual void | vtlog_warn (struct timeval *t, const char *component, const char *format, va_list va) |
virtual void | vtlog_error (struct timeval *t, const char *component, const char *format, va_list va) |
virtual void | handle_network_message (FawkesNetworkMessage *msg) |
virtual void | client_connected (unsigned int clid) |
virtual void | client_disconnected (unsigned int clid) |
![]() | |
Logger (LogLevel log_level=LL_DEBUG) | |
Constructor. More... | |
virtual | ~Logger () |
Virtual empty destructor. More... | |
virtual void | set_loglevel (LogLevel level) |
Sets the log level. More... | |
virtual LogLevel | loglevel () |
Get log level. More... | |
virtual void | log (LogLevel level, const char *component, const char *format,...) |
Log message of given log level. More... | |
virtual void | log (LogLevel level, const char *component, Exception &e) |
Log exception for given log level. More... | |
virtual void | vlog (LogLevel level, const char *component, const char *format, va_list va) |
Log message for given log level. More... | |
virtual void | tlog (LogLevel level, struct timeval *t, const char *component, const char *format,...) |
Log message of given log level and time. More... | |
virtual void | tlog (LogLevel level, struct timeval *t, const char *component, Exception &e) |
Log exception for given log level. More... | |
virtual void | vtlog (LogLevel level, struct timeval *t, const char *component, const char *format, va_list va) |
Log message for given log level and time. More... | |
![]() | |
FawkesNetworkHandler (unsigned short int id) | |
Constructor. More... | |
virtual | ~FawkesNetworkHandler () |
Destructor. More... | |
unsigned short int | id () const |
Get the component ID for this handler. More... | |
Additional Inherited Members | |
![]() | |
LogLevel | log_level |
Minimum log level. More... | |
Interface for logging to network clients. The NetwokLogger will pipe all output to clients that subscribed for log messages.
Definition at line 46 of file network_logger.h.
NetworkLogger message types.
Enumerator | |
---|---|
MSGTYPE_SUBSCRIBE | Subscribe for logging messages. |
MSGTYPE_UNSUBSCRIBE | Unsubscribe from receiving logging messages. |
MSGTYPE_LOGMESSAGE | Log message. |
Definition at line 89 of file network_logger.h.
fawkes::NetworkLogger::NetworkLogger | ( | FawkesNetworkHub * | hub, |
LogLevel | log_level = LL_DEBUG |
||
) |
Constructor.
hub | FawkesNetworkHub to use to send and receive messages |
log_level | minimum level to log |
Definition at line 61 of file network_logger.cpp.
|
virtual |
Destructor.
Definition at line 70 of file network_logger.cpp.
References MSGTYPE_LOGMESSAGE, and fawkes::FawkesNetworkHub::send().
|
virtual |
Called when a new client connected. If any actions need to be taken on your side this is the place to do it.
clid | client ID of new client |
Implements fawkes::FawkesNetworkHandler.
Definition at line 393 of file network_logger.cpp.
References fawkes::LockList::remove_locked().
|
virtual |
Called when a client disconnected. If any actions need to be taken on your side this is the place to do it. Note that you cannot send any further messages to this client!
clid | client ID of disconnected client |
Implements fawkes::FawkesNetworkHandler.
Definition at line 398 of file network_logger.cpp.
|
virtual |
Called for incoming messages that are addressed to the correct component ID. Note that this message should be processed really really fast! A good idea is to enqueue the message in an inbound queue (remember to ref() it!) and then process it in the next run of loop() or wakeup a processing thread.
msg | message to handle. If you want to keep this message you have to ref() it! It is guaranteed that the message will not be erased during the handleNetworkMessage() run, but afterwards no guarantee is made. So if you want to store the message internally for example for later processing you have to reference the message. |
Implements fawkes::FawkesNetworkHandler.
Definition at line 381 of file network_logger.cpp.
|
virtual |
Log debug message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 173 of file network_logger.cpp.
|
virtual |
Log debug exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 209 of file network_logger.cpp.
|
virtual |
Log error message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 200 of file network_logger.cpp.
|
virtual |
Log error exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 245 of file network_logger.cpp.
|
virtual |
Log informational message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 182 of file network_logger.cpp.
|
virtual |
Log informational exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 221 of file network_logger.cpp.
|
virtual |
Log warning message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 191 of file network_logger.cpp.
|
virtual |
Log warning exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 233 of file network_logger.cpp.
|
virtual |
Log debug message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 297 of file network_logger.cpp.
|
virtual |
Log debug exception for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 333 of file network_logger.cpp.
|
virtual |
Log error message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 324 of file network_logger.cpp.
|
virtual |
Log error exception for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 369 of file network_logger.cpp.
|
virtual |
Log informational message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 306 of file network_logger.cpp.
|
virtual |
Log informational exception for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 345 of file network_logger.cpp.
|
virtual |
Log warning message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Implements fawkes::Logger.
Definition at line 315 of file network_logger.cpp.
|
virtual |
Log warning exception for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 357 of file network_logger.cpp.
|
virtual |
Log debug message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 133 of file network_logger.cpp.
|
virtual |
Log error message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 163 of file network_logger.cpp.
|
virtual |
Log informational message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 143 of file network_logger.cpp.
|
virtual |
Log warning message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 153 of file network_logger.cpp.
|
virtual |
Log debug message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 257 of file network_logger.cpp.
|
virtual |
Log error message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 287 of file network_logger.cpp.
|
virtual |
Log informational message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 267 of file network_logger.cpp.
|
virtual |
Log warning message for specific time.
t | time for this message to log |
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variable argument list |
Implements fawkes::Logger.
Definition at line 277 of file network_logger.cpp.