[Libreoffice-commits] online.git: common/Log.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 17 09:55:06 UTC 2018


 common/Log.hpp |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 351193e1b76cae1e4e8bad0af94bac5b27ff8ae4
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Oct 17 12:54:36 2018 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Oct 17 12:54:36 2018 +0300

    Don't bother logging the full pathname __FILE__ on iOS

diff --git a/common/Log.hpp b/common/Log.hpp
index 7aaf4174d..755f90750 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -223,11 +223,19 @@ namespace Log
 
 }
 
+#ifndef IOS
+#define LOG_FILE_NAME(f) f
+#else
+// We know that when building with Xcode, __FILE__ will always be a full path, with several slashes,
+// so this will always work. We want just the file name, they are unique anyway.
+#define LOG_FILE_NAME(f) (strrchr(f, '/')+1)
+#endif
+
 #define LOG_END(LOG, FILEP)                             \
     do                                                  \
     {                                                   \
         if (FILEP)                                      \
-            LOG << "| " << __FILE__ << ':' << __LINE__; \
+            LOG << "| " << LOG_FILE_NAME(__FILE__) << ':' << __LINE__; \
     } while (false)
 
 #define LOG_BODY_(LOG, PRIO, LVL, X, FILEP)                                                 \


More information about the Libreoffice-commits mailing list