Commit 94955644 authored by 's avatar

Call glog_internal_namespace_::ProgramInvocationShortName() explicitly.

Otherwise, we may call google::ProgramInvocationShortName() in gflags.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@68 eb4d4688-79bd-11dd-afb4-1d65580434c0
parent 5bf76bb4
...@@ -530,7 +530,7 @@ inline void LogDestination::MaybeLogToEmail(LogSeverity severity, ...@@ -530,7 +530,7 @@ inline void LogDestination::MaybeLogToEmail(LogSeverity severity,
to += addresses_; to += addresses_;
} }
const string subject(string("[LOG] ") + LogSeverityNames[severity] + ": " + const string subject(string("[LOG] ") + LogSeverityNames[severity] + ": " +
ProgramInvocationShortName()); glog_internal_namespace_::ProgramInvocationShortName());
string body(hostname()); string body(hostname());
body += "\n\n"; body += "\n\n";
body.append(message, len); body.append(message, len);
...@@ -613,7 +613,7 @@ LogFileObject::LogFileObject(LogSeverity severity, ...@@ -613,7 +613,7 @@ LogFileObject::LogFileObject(LogSeverity severity,
const char* base_filename) const char* base_filename)
: base_filename_selected_(base_filename != NULL), : base_filename_selected_(base_filename != NULL),
base_filename_((base_filename != NULL) ? base_filename : ""), base_filename_((base_filename != NULL) ? base_filename : ""),
symlink_basename_(ProgramInvocationShortName()), symlink_basename_(glog_internal_namespace_::ProgramInvocationShortName()),
filename_extension_(), filename_extension_(),
file_(NULL), file_(NULL),
severity_(severity), severity_(severity),
...@@ -796,7 +796,8 @@ void LogFileObject::Write(bool force_flush, ...@@ -796,7 +796,8 @@ void LogFileObject::Write(bool force_flush,
// //
// Where does the file get put? Successively try the directories // Where does the file get put? Successively try the directories
// "/tmp", and "." // "/tmp", and "."
string stripped_filename(ProgramInvocationShortName()); // in cmdlineflag string stripped_filename(
glog_internal_namespace_::ProgramInvocationShortName());
string hostname; string hostname;
GetHostName(&hostname); GetHostName(&hostname);
...@@ -1306,7 +1307,8 @@ void LogMessage::SendToSyslogAndLog() { ...@@ -1306,7 +1307,8 @@ void LogMessage::SendToSyslogAndLog() {
// Before any calls to syslog(), make a single call to openlog() // Before any calls to syslog(), make a single call to openlog()
static bool openlog_already_called = false; static bool openlog_already_called = false;
if (!openlog_already_called) { if (!openlog_already_called) {
openlog(ProgramInvocationShortName(), LOG_CONS | LOG_NDELAY | LOG_PID, openlog(glog_internal_namespace_::ProgramInvocationShortName(),
LOG_CONS | LOG_NDELAY | LOG_PID,
LOG_USER); LOG_USER);
openlog_already_called = true; openlog_already_called = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment