pub http_port: Option<u16>,
pub rocket_workers: Option<u16>,
pub template_dir: Option<String>,
+ pub log: toml::Value,
}
#[derive(Debug,Clone)]
pub http_port: Option<u16>,
pub rocket_workers: u16,
pub template_dir: String,
+ pub log: LogSpecification,
}
impl TryFrom<ServerConfigSpec> for ServerConfig {
fn try_from(spec: ServerConfigSpec) -> ServerConfig {
let ServerConfigSpec {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir
+ http_port, rocket_workers, template_dir, log,
} = spec;
let save_directory = save_directory
let template_dir = template_dir
.unwrap_or_else(|| DEFAULT_TEMPLATE_DIR.to_owned());
+ let log = toml::to_string(&log)?;
+ let log = LogSpecification::from_toml(&log)
+ .context("log specification")?;
+
ServerConfig {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir
+ http_port, rocket_workers, template_dir, log,
}
}
}