[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - 2 commits - common/Log.cpp

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 24 08:04:39 UTC 2020


 common/Log.cpp |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 9d3b3a2c2381ffac222f85493cb1a1430c1a52b3
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jul 10 11:33:14 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Sep 24 10:14:23 2020 +0300

    Don't bother outputting the thread id in hex for iOS to log
    
    We output the informative name we give ourselves to the thread anyway
    which is much more useful.
    
    Change-Id: I74721cc0014fa657adfb6ecea05bcd7f846421a4
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98477
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/common/Log.cpp b/common/Log.cpp
index 0ae19df66..bc3637183 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -189,14 +189,15 @@ namespace Log
         // Don't bother with the "Source" which would be just "Mobile" always and non-informative as
         // there is just one process in the app anyway.
         char *pos = buffer;
+
+        // Don't bother with the thread identifier either. We output the thread name which is much
+        // more useful anyway.
 #else
         // Note that snprintf is deemed signal-safe in most common implementations.
         char* pos = strcopy((Source.getInited() ? Source.getId().c_str() : "<shutdown>"), buffer);
         *pos++ = '-';
-#endif
 
         // Thread ID.
-#ifdef __linux
         const long osTid = Util::getThreadId();
         if (osTid > 99999)
         {
@@ -213,17 +214,10 @@ namespace Log
             to_ascii_fixed<5>(pos, osTid);
             pos += 5;
         }
-#elif defined IOS
-        uint64_t osTid;
-        pthread_threadid_np(nullptr, &osTid);
-        snprintf(pos, 32, "%#.05llx", osTid);
-        // Skip to end.
-        while (*pos)
-            pos++;
+        *pos++ = ' ';
 #endif
 
         // YYYY-MM-DD.
-        *pos++ = ' ';
         to_ascii_fixed<4>(pos, time.year());
         pos[4] = '-';
         pos += 5;
commit 01d84a7003aa010a90f63c61ca94891417ddc0c1
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Jul 2 22:15:08 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Sep 24 09:44:25 2020 +0300

    Drop the fixed prefix ("Mobile-") from log output in the iOS app
    
    There is just one process in the app so logging its name which always
    is the same is pointless.
    
    Change-Id: I89dbabc26457a142d35bf748981edb670cba4732

diff --git a/common/Log.cpp b/common/Log.cpp
index e001980af..0ae19df66 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -185,9 +185,15 @@ namespace Log
 
     char* prefix(const Poco::DateTime& time, char* buffer, const char* level)
     {
+#ifdef IOS
+        // Don't bother with the "Source" which would be just "Mobile" always and non-informative as
+        // there is just one process in the app anyway.
+        char *pos = buffer;
+#else
         // Note that snprintf is deemed signal-safe in most common implementations.
         char* pos = strcopy((Source.getInited() ? Source.getId().c_str() : "<shutdown>"), buffer);
         *pos++ = '-';
+#endif
 
         // Thread ID.
 #ifdef __linux


More information about the Libreoffice-commits mailing list