[Libreoffice-commits] online.git: loolwsd/Log.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Oct 31 06:10:16 UTC 2016
loolwsd/Log.hpp | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 8be8311eaafd01ea2cd012910589b04f66a8b694
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Mon Oct 31 02:00:50 2016 -0400
loolwsd: new logging macros with lower overhead
Change-Id: I6889af4dd18692877469e8b24671aaf4649055e5
Reviewed-on: https://gerrit.libreoffice.org/30422
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/Log.hpp b/loolwsd/Log.hpp
index 799fd77..7fe521d 100644
--- a/loolwsd/Log.hpp
+++ b/loolwsd/Log.hpp
@@ -170,6 +170,13 @@ namespace Log
}
}
+#define LOG_TRC(X) if (Log::traceEnabled()) { std::ostringstream oss; oss << Log::prefix("TRC") << X; Log::logger().trace(oss.str()); }
+#define LOG_DBG(X) if (Log::debugEnabled()) { std::ostringstream oss; oss << Log::prefix("DBG") << X; Log::logger().debug(oss.str()); }
+#define LOG_INF(X) if (Log::infoEnabled()) { std::ostringstream oss; oss << Log::prefix("INF") << X; Log::logger().information(oss.str()); }
+#define LOG_WRN(X) if (Log::warnEnabled()) { std::ostringstream oss; oss << Log::prefix("WRN") << X; Log::logger().warning(oss.str()); }
+#define LOG_ERR(X) if (Log::errorEnabled()) { std::ostringstream oss; oss << Log::prefix("ERR") << X; Log::logger().error(oss.str()); }
+#define LOG_FTL(X) if (Log::fatalEnabled()) { std::ostringstream oss; oss << Log::prefix("FTL") << X; Log::logger().fatal(oss.str()); }
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list