Remove log-destination-override features
This removes the feature to be able to override log destinations from the commandline. This feature is removed because the --override-config feature from the runtime already contains this functionality. It is a little more complex to use, though this is a feature hardly used at all, so I rather go for less code (less complexity) here than feature bloat. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
4c0baa58f4
commit
e4ef6f0649
3 changed files with 1 additions and 31 deletions
|
@ -421,8 +421,5 @@ fn forward_commandline_arguments(m: &ArgMatches, scmd: &mut Vec<String>) {
|
||||||
|
|
||||||
push(Some("ignore-ids"),
|
push(Some("ignore-ids"),
|
||||||
Runtime::arg_ignore_ids_name(), m , scmd);
|
Runtime::arg_ignore_ids_name(), m , scmd);
|
||||||
|
|
||||||
push(None , Runtime::arg_logdest_name() , m , scmd);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,8 +280,8 @@ fn translate_destinations(raw: &Vec<Value>) -> Result<Vec<LogDestination>> {
|
||||||
fn aggregate_global_destinations(matches: &ArgMatches, config: Option<&Value>)
|
fn aggregate_global_destinations(matches: &ArgMatches, config: Option<&Value>)
|
||||||
-> Result<Vec<LogDestination>>
|
-> Result<Vec<LogDestination>>
|
||||||
{
|
{
|
||||||
|
|
||||||
match config {
|
match config {
|
||||||
|
None => Ok(vec![LogDestination::default()]),
|
||||||
Some(cfg) => cfg
|
Some(cfg) => cfg
|
||||||
.read("imag.logging.destinations")
|
.read("imag.logging.destinations")
|
||||||
.map_err(Error::from)
|
.map_err(Error::from)
|
||||||
|
@ -293,21 +293,6 @@ fn aggregate_global_destinations(matches: &ArgMatches, config: Option<&Value>)
|
||||||
Error::from(err_msg(msg))
|
Error::from(err_msg(msg))
|
||||||
})
|
})
|
||||||
.and_then(translate_destinations),
|
.and_then(translate_destinations),
|
||||||
None => {
|
|
||||||
if let Some(values) = matches.value_of(Runtime::arg_logdest_name()) {
|
|
||||||
// parse logdest specification from commandline
|
|
||||||
|
|
||||||
values.split(",")
|
|
||||||
.fold(Ok(vec![]), move |acc, dest| {
|
|
||||||
acc.and_then(|mut v| {
|
|
||||||
v.push(translate_destination(dest)?);
|
|
||||||
Ok(v)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
Ok(vec![ LogDestination::default() ])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -245,13 +245,6 @@ impl<'a> Runtime<'a> {
|
||||||
.required(false)
|
.required(false)
|
||||||
.takes_value(true))
|
.takes_value(true))
|
||||||
|
|
||||||
.arg(Arg::with_name(Runtime::arg_logdest_name())
|
|
||||||
.long(Runtime::arg_logdest_name())
|
|
||||||
.help("Override the logging destinations from the configuration: values can be seperated by ',', a value of '-' marks the stderr output, everything else is expected to be a path")
|
|
||||||
.required(false)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("LOGDESTS"))
|
|
||||||
|
|
||||||
.arg(Arg::with_name(Runtime::arg_ignore_ids_name())
|
.arg(Arg::with_name(Runtime::arg_ignore_ids_name())
|
||||||
.long(Runtime::arg_ignore_ids_name())
|
.long(Runtime::arg_ignore_ids_name())
|
||||||
.help("Do not assume that the output is a pipe to another imag command. This overrides the default behaviour where imag only prints the IDs of the touched entries to stdout if stdout is a pipe.")
|
.help("Do not assume that the output is a pipe to another imag command. This overrides the default behaviour where imag only prints the IDs of the touched entries to stdout if stdout is a pipe.")
|
||||||
|
@ -344,11 +337,6 @@ impl<'a> Runtime<'a> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the argument name for the logging destination
|
|
||||||
pub fn arg_logdest_name() -> &'static str {
|
|
||||||
"logging-destinations"
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "pub_logging_initialization")]
|
#[cfg(feature = "pub_logging_initialization")]
|
||||||
pub fn init_logger(matches: &ArgMatches, config: Option<&Value>) {
|
pub fn init_logger(matches: &ArgMatches, config: Option<&Value>) {
|
||||||
Self::_init_logger(matches, config)
|
Self::_init_logger(matches, config)
|
||||||
|
|
Loading…
Reference in a new issue