diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-11-16 23:12:16 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-11-16 23:12:16 +0000 |
commit | 521c70553125b6da53c65a60e36fcc18aec36565 (patch) | |
tree | dc41c006f1c4ac7f40f98be7f1ef318c13e5d15f /lib/common/Logging.cpp | |
parent | 258e57eaecfe85356181706d70141a2563d22737 (diff) |
Add option to truncate log file at start of every backup.
Prevents backup log files from becoming too large.
Diffstat (limited to 'lib/common/Logging.cpp')
-rw-r--r-- | lib/common/Logging.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp index 97209104..ce8afcbb 100644 --- a/lib/common/Logging.cpp +++ b/lib/common/Logging.cpp @@ -565,7 +565,7 @@ bool HideSpecificExceptionGuard::IsHidden(int type, int subtype) // -------------------------------------------------------------------------- std::string Logging::OptionParser::GetOptionString() { - return "PqQt:TUvVW:"; + return "NPqQt:TUvVW:"; } // -------------------------------------------------------------------------- @@ -583,6 +583,12 @@ int Logging::OptionParser::ProcessOption(signed int option) { switch(option) { + case 'N': + { + mTruncateLogFile = true; + } + break; + case 'P': { Console::SetShowPID(true); @@ -692,6 +698,7 @@ int Logging::OptionParser::ProcessOption(signed int option) std::string Logging::OptionParser::GetUsageString() { return + " -N Truncate log file at startup and on backup start\n" " -P Show process ID (PID) in console output\n" " -q Run more quietly, reduce verbosity level by one, can repeat\n" " -Q Run at minimum verbosity, log nothing to console and system\n" |