&GlobalArgumentCompletion, true, autoindex);
rc = 0;
} else if (command) {
+ Logger::DisableTimestamp(true);
#ifndef _WIN32
if (command->GetImpersonationLevel() == ImpersonateRoot) {
if (getuid() != 0) {
std::set<Logger::Ptr> Logger::m_Loggers;
boost::mutex Logger::m_Mutex;
bool Logger::m_ConsoleLogEnabled = true;
+bool Logger::m_TimestampEnabled = true;
LogSeverity Logger::m_ConsoleLogSeverity = LogInformation;
void Logger::StaticInitialize(void)
{
return m_ConsoleLogSeverity;
}
+
+void Logger::DisableTimestamp(bool disable)
+{
+ m_TimestampEnabled = !disable;
+}
+
+bool Logger::IsTimestampEnabled(void)
+{
+ return m_TimestampEnabled;
+}
static void DisableConsoleLog(void);
static bool IsConsoleLogEnabled(void);
+ static void DisableTimestamp(bool);
+ static bool IsTimestampEnabled(void);
static void SetConsoleLogSeverity(LogSeverity logSeverity);
static LogSeverity GetConsoleLogSeverity(void);
static boost::mutex m_Mutex;
static std::set<Logger::Ptr> m_Loggers;
static bool m_ConsoleLogEnabled;
+ static bool m_TimestampEnabled;
static LogSeverity m_ConsoleLogSeverity;
};
m_Stream = stream;
m_OwnsStream = ownsStream;
-
+
m_FlushLogTimer = make_shared<Timer>();
m_FlushLogTimer->SetInterval(1);
m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
boost::mutex::scoped_lock lock(m_Mutex);
- stream << "[" << timestamp << "] ";
+ if (Logger::IsTimestampEnabled())
+ stream << "[" << timestamp << "] ";
int color;
{
ProcessLogEntry(*m_Stream, entry);
}
-
*/
int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::string>& ap) const
{
+ if (!vm.count("validate"))
+ Logger::DisableTimestamp(false);
+
ScriptVariable::Set("UseVfork", true, false, true);
Application::MakeVariablesConstant();