summaryrefslogtreecommitdiff
path: root/server/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/main.cc')
-rw-r--r--server/main.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/main.cc b/server/main.cc
index 8a4e74c..dfbe024 100644
--- a/server/main.cc
+++ b/server/main.cc
@@ -104,7 +104,12 @@ class TpmManagerDaemon : 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);
TpmManagerDaemon daemon;
LOG(INFO) << "TpmManager Daemon Started.";
return daemon.Run();