summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUtkarsh Sanghi <usanghi@google.com>2015-11-09 09:05:34 -0800
committerUtkarsh Sanghi <usanghi@google.com>2015-11-09 09:17:31 -0800
commitb3c9cdcef463064d7ac8f1e6b4b88e62433f9d5d (patch)
treefebe3db56bf6f20af5f2f9ad7e6e3becb88a8a0c
parentf534acf6cc48569ab51bde986fec1c931e26ee78 (diff)
downloadattestation-master.tar.gz
attestation: Unify logging locationHEADmastermain
This CL defaults attestation daemon logging to syslog. Logs can be forwared to stderr by passing the --log_to_stderr flag. Attestation_client now logs by default to stderr. Bug: 25567627 TEST=None Change-Id: If87ceffcc48651ff69a0bdd187b7365296ab33a9
-rw-r--r--client/main.cc2
-rw-r--r--server/main.cc7
2 files changed, 7 insertions, 2 deletions
diff --git a/client/main.cc b/client/main.cc
index abb3e4e..868b42c 100644
--- a/client/main.cc
+++ b/client/main.cc
@@ -497,7 +497,7 @@ class ClientLoop : public ClientLoopBase {
int main(int argc, char* argv[]) {
base::CommandLine::Init(argc, argv);
- brillo::InitLog(brillo::kLogToSyslog | brillo::kLogToStderr);
+ brillo::InitLog(brillo::kLogToStderr);
attestation::ClientLoop loop;
return loop.Run();
}
diff --git a/server/main.cc b/server/main.cc
index 3b001f4..b22ba18 100644
--- a/server/main.cc
+++ b/server/main.cc
@@ -100,7 +100,12 @@ class AttestationDaemon : public brillo::DBusServiceDaemon {
int main(int argc, char* argv[]) {
base::CommandLine::Init(argc, argv);
- brillo::InitLog(brillo::kLogToSyslog | brillo::kLogToStderr);
+ base::CommandLine *cl = base::CommandLine::ForCurrentProcess();
+ int flags = brillo::kLogToSyslog;
+ if (cl->HasSwitch("log_to_stderr")) {
+ flags |= brillo::kLogToStderr;
+ }
+ brillo::InitLog(flags);
AttestationDaemon daemon;
LOG(INFO) << "Attestation Daemon Started.";
InitMinijailSandbox();