all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 4fcff832fcb6fd71a63616deefbeca308fe88ceb 2564 bytes (raw)
name: gnu/packages/patches/libbase-use-own-logging.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@google.com>
Date: Thu, 28 Jul 2016 15:15:28 -0700
Subject: [PATCH] libbase should use its own logging!

Not doing so led to us using a bogus log tag.

Bug: http://b/30281203
Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f
---
 base/file.cpp    | 11 +++++------
 base/logging.cpp |  3 +--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/base/file.cpp b/base/file.cpp
index da1adba19..4e7ac82d1 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -24,9 +24,8 @@
 #include <string>
 
 #include "android-base/macros.h"  // For TEMP_FAILURE_RETRY on Darwin.
+#include "android-base/logging.h"
 #include "android-base/utf8.h"
-#define LOG_TAG "base.file"
-#include "cutils/log.h"
 #include "utils/Compat.h"
 
 namespace android {
@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, const std::string& path,
   int flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O_BINARY;
   int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode));
   if (fd == -1) {
-    ALOGE("android::WriteStringToFile open failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile open failed";
     return false;
   }
 
   // We do an explicit fchmod here because we assume that the caller really
   // meant what they said and doesn't want the umask-influenced mode.
   if (fchmod(fd, mode) == -1) {
-    ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile fchmod failed";
     return CleanUpAfterFailedWrite(path);
   }
   if (fchown(fd, owner, group) == -1) {
-    ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile fchown failed";
     return CleanUpAfterFailedWrite(path);
   }
   if (!WriteStringToFd(content, fd)) {
-    ALOGE("android::WriteStringToFile write failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile write failed";
     return CleanUpAfterFailedWrite(path);
   }
   close(fd);
diff --git a/base/logging.cpp b/base/logging.cpp
index 769c266c9..959bb8b05 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -43,12 +43,11 @@
 
 #include "android-base/macros.h"
 #include "android-base/strings.h"
-#include "cutils/threads.h"
 
 // Headers for LogMessage::LogLine.
 #ifdef __ANDROID__
 #include <android/set_abort_message.h>
-#include "cutils/log.h"
+#include "log/log.h"
 #else
 #include <sys/types.h>
 #include <unistd.h>
-- 
2.11.0


debug log:

solving 4fcff832f ...
found 4fcff832f in https://yhetil.org/guix/20170415183146.45f95eda@lepiller.eu/ ||
	https://yhetil.org/guix/20170416112200.51037253@lepiller.eu/ ||
	https://yhetil.org/guix/20170417104022.3947db41@lepiller.eu/ ||
	https://yhetil.org/guix/87fuluml2f.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me/

applying [1/1] https://yhetil.org/guix/20170415183146.45f95eda@lepiller.eu/
diff --git a/gnu/packages/patches/libbase-use-own-logging.patch b/gnu/packages/patches/libbase-use-own-logging.patch
new file mode 100644
index 000000000..4fcff832f

1:27: trailing whitespace.
 
1:34: trailing whitespace.
 
1:44: trailing whitespace.
 
1:68: trailing whitespace.
 
1:72: trailing whitespace.
 
Checking patch gnu/packages/patches/libbase-use-own-logging.patch...
Applied patch gnu/packages/patches/libbase-use-own-logging.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

skipping https://yhetil.org/guix/20170416112200.51037253@lepiller.eu/ for 4fcff832f
skipping https://yhetil.org/guix/20170417104022.3947db41@lepiller.eu/ for 4fcff832f
skipping https://yhetil.org/guix/87fuluml2f.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me/ for 4fcff832f
index at:
100644 4fcff832fcb6fd71a63616deefbeca308fe88ceb	gnu/packages/patches/libbase-use-own-logging.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.