summaryrefslogtreecommitdiff
path: root/lib/server/Daemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-01-31 23:44:54 +0000
committerChris Wilson <chris+github@qwirx.com>2008-01-31 23:44:54 +0000
commit86f0df155e183924693f6bacfc0a158a14f05bed (patch)
treed7931c3b160f54dbd6e20dcd9841fdb4579da12b /lib/server/Daemon.cpp
parent2ccdaf9a575f4cc0d758a87300b7cf51d96c9779 (diff)
Add support for microsecond timestamps and PID logging on console log
for daemons.
Diffstat (limited to 'lib/server/Daemon.cpp')
-rw-r--r--lib/server/Daemon.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp
index bdbbb433..0f07eac3 100644
--- a/lib/server/Daemon.cpp
+++ b/lib/server/Daemon.cpp
@@ -106,7 +106,7 @@ std::string Daemon::GetOptionString()
#ifndef WIN32
"DFk"
#endif
- "hqvVt:T";
+ "hPqvVt:TU";
}
void Daemon::Usage()
@@ -125,11 +125,13 @@ void Daemon::Usage()
" -F Do not fork into background, but fork to serve multiple clients\n"
" -k Keep console open after fork, keep writing log messages to it\n"
#endif
+ " -P Show process ID (PID) in console output\n"
" -q Run more quietly, reduce verbosity level by one, can repeat\n"
" -v Run more verbosely, increase verbosity level by one, can repeat\n"
" -V Run at maximum verbosity\n"
" -t <tag> Tag console output with specified marker\n"
- " -T Timestamp console output\n";
+ " -T Timestamp console output\n"
+ " -U Timestamp console output with microseconds\n";
}
// --------------------------------------------------------------------------
@@ -181,6 +183,12 @@ int Daemon::ProcessOption(signed int option)
}
break;
+ case 'P':
+ {
+ Console::SetShowPID(true);
+ }
+ break;
+
case 'q':
{
if(mLogLevel == Log::NOTHING)
@@ -225,6 +233,13 @@ int Daemon::ProcessOption(signed int option)
}
break;
+ case 'U':
+ {
+ Console::SetShowTime(true);
+ Console::SetShowTimeMicros(true);
+ }
+ break;
+
case '?':
{
BOX_FATAL("Unknown option on command line: "