@@ -36,9 +36,9 @@ def build_main_arg_parser() -> argparse.ArgumentParser:
36
36
default = False ,
37
37
)
38
38
group .add_argument (
39
- '--log-file-suffix ' ,
40
- dest = 'log_file_suffix ' ,
41
- help = 'Suffix of the log file name ' ,
39
+ '--log-filepath-prefix ' ,
40
+ dest = 'log_filepath_prefix ' ,
41
+ help = 'Prefix of the log file path ' ,
42
42
default = '.scicat_ingestor_log' ,
43
43
)
44
44
group .add_argument (
@@ -62,8 +62,8 @@ def build_main_arg_parser() -> argparse.ArgumentParser:
62
62
default = 'mail' ,
63
63
)
64
64
group .add_argument (
65
- '--log-prefix' ,
66
- dest = 'log_prefix ' ,
65
+ '--log-message- prefix' ,
66
+ dest = 'log_message_prefix ' ,
67
67
help = 'Prefix for log messages' ,
68
68
default = ' SFI: ' ,
69
69
)
@@ -92,13 +92,13 @@ class RunOptions:
92
92
config_file : str
93
93
verbose : bool
94
94
file_log : bool
95
- log_file_suffix : str
95
+ log_filepath_prefix : str
96
96
file_log_timestamp : bool
97
97
system_log : bool
98
- system_log_facility : str
99
- log_prefix : str
98
+ log_message_prefix : str
100
99
log_level : str
101
100
check_by_job_id : bool
101
+ system_log_facility : Optional [str ] = None
102
102
pyscicat : Optional [str ] = None
103
103
104
104
@@ -109,6 +109,19 @@ class ScicatConfig:
109
109
run_options : RunOptions
110
110
"""Merged configuration dictionary with command line arguments."""
111
111
112
+ def to_dict (self ) -> dict :
113
+ """Return the configuration as a dictionary."""
114
+ from dataclasses import asdict
115
+
116
+ # Deep copy the original dictionary recursively
117
+ original_dict = dict (self .original_dict )
118
+ for key , value in original_dict .items ():
119
+ if isinstance (value , Mapping ):
120
+ original_dict [key ] = dict (value )
121
+
122
+ copied = ScicatConfig (original_dict , self .run_options )
123
+ return asdict (copied )
124
+
112
125
113
126
def build_scicat_config (input_args : argparse .Namespace ) -> ScicatConfig :
114
127
"""Merge configuration from the configuration file and input arguments."""
0 commit comments