From bbc051a7641bbf5d6c6aa524cf7792bab7768d07 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 9 Sep 2013 15:27:27 -0700 Subject: [PATCH] add doxygen comments to refactored Logging class --- libraries/shared/src/Logging.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/shared/src/Logging.h b/libraries/shared/src/Logging.h index 0bd6197b9a..c4f921070a 100644 --- a/libraries/shared/src/Logging.h +++ b/libraries/shared/src/Logging.h @@ -20,12 +20,28 @@ const char STAT_TYPE_TIMER = 't'; const char STAT_TYPE_COUNTER = 'c'; const char STAT_TYPE_GAUGE = 'g'; +/// Handles custom message handling and sending of stats/logs to Logstash instance class Logging { public: + /// \return the socket used to send stats to logstash static sockaddr* socket(); + + /// checks if this target should send stats to logstash, given its current environment + /// \return true if the caller should send stats to logstash static bool shouldSendStats(); + + /// stashes a float value to Logstash instance + /// \param statType a stat type from the constants in this file + /// \param key the key at which to store the stat + /// \param value the value to store static void stashValue(char statType, const char* key, float value); + + /// sets the target name to output via the verboseMessageHandler, called once before logging begins + /// \param targetName the desired target name to output in logs static void setTargetName(const char* targetName); + + /// a qtMessageHandler that can be hooked up to a target that links to Qt + /// prints various process, message type, and time information static void verboseMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message); private: static sockaddr_in logstashSocket;