From f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 29 Sep 2010 20:39:56 +0200 Subject: Add log file rotation support based on ExceptionFault's work. This patch adds options to enable log rotations base on files size and or change of date. Note: Zip support will be added in a second commit. Reviewed-by: CodyMartin, Thorbjorn. --- src/utils/string.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/utils/string.hpp') diff --git a/src/utils/string.hpp b/src/utils/string.hpp index 9f2b4ac..6127bfe 100644 --- a/src/utils/string.hpp +++ b/src/utils/string.hpp @@ -22,6 +22,7 @@ #define UTILS_STRING_H #include +#include namespace utils { @@ -67,6 +68,19 @@ namespace utils * @param str the string to trim spaces off */ void trim(std::string &str); + + /** + * Converts the given value to a string using std::stringstream. + * + * @param arg the value to convert to a string + * @return the string representation of arg + */ + template std::string toString(const T &arg) + { + std::stringstream ss; + ss << arg; + return ss.str(); + } } #endif // UTILS_STRING_H -- cgit