mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-18 13:03:28 +02:00
feat: with loggers
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::logger::DynLogger;
|
||||
|
||||
pub struct Config {
|
||||
pub workdir_path: Option<PathBuf>,
|
||||
pub config_path: Option<PathBuf>,
|
||||
pub timeout_ms: u64,
|
||||
pub execute_timeout_ms: Option<u64>,
|
||||
pub logger: Option<DynLogger>,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self::new(None, None, None, None)
|
||||
Self::new(None, None, None, None, None)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +22,14 @@ impl Config {
|
||||
config_path: Option<PathBuf>,
|
||||
timeout_ms: Option<u64>,
|
||||
execute_timeout_ms: Option<u64>,
|
||||
logger: Option<DynLogger>,
|
||||
) -> Self {
|
||||
Self {
|
||||
workdir_path,
|
||||
config_path,
|
||||
timeout_ms: timeout_ms.unwrap_or(10 * 1000),
|
||||
execute_timeout_ms,
|
||||
logger,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user