diff --git a/CHANGELOG b/CHANGELOG index 1f77be175f..aa2b5eb7b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,10 @@ v3.5.1 (XXXX-XX-XX) callable with constant arguments. This will allow running queries where all arguments for these functions are deterministic and do not depend on loop variables. +* Automatically turn values for deprecated startup option parameters + `--log.use-microtime` and `--log.use-local-time` into equivalent option values + of the new, preferred option `--log.time-format`. + * Drop collection action to timeout more quickly to stay on fast lane. * Make arangorestore restore data into the `_users` collection last. This is to diff --git a/lib/Logger/LoggerFeature.cpp b/lib/Logger/LoggerFeature.cpp index 7f729f357d..d509462cc5 100644 --- a/lib/Logger/LoggerFeature.cpp +++ b/lib/Logger/LoggerFeature.cpp @@ -210,6 +210,21 @@ void LoggerFeature::validateOptions(std::shared_ptr options) { << "cannot combine `--log.time-format` with either `--log.use-microtime` or `--log.use-local-time`"; FATAL_ERROR_EXIT(); } + + // convert the deprecated options into the new timeformat + if (options->processingResult().touched("log.use-local-time")) { + _timeFormatString = "local-datestring"; + // the following call ensures the string is actually valid. + // if not valid, the following call will throw an exception and + // abort the startup + LogTimeFormats::formatFromName(_timeFormatString); + } else if (options->processingResult().touched("log.use-microtime")) { + _timeFormatString = "timestamp-micros"; + // the following call ensures the string is actually valid. + // if not valid, the following call will throw an exception and + // abort the startup + LogTimeFormats::formatFromName(_timeFormatString); + } if (!_fileMode.empty()) { try {