1- mutable struct LinearVerbosity{Enabled} <: AbstractVerbositySpecifier{Enabled}
1+ LinearSolve. @concrete struct LinearVerbosity{Enabled} < :
2+ AbstractVerbositySpecifier{Enabled}
23 # Error control
3- default_lu_fallback:: MessageLevel
4+ default_lu_fallback
45 # Performance
5- no_right_preconditioning:: MessageLevel
6+ no_right_preconditioning
67 # Numerical
7- using_iterative_solvers:: MessageLevel
8- using_IterativeSolvers:: MessageLevel
9- IterativeSolvers_iterations:: MessageLevel
10- KrylovKit_verbosity:: MessageLevel
11- KrylovJL_verbosity:: MessageLevel
12- HYPRE_verbosity:: MessageLevel
13- pardiso_verbosity:: MessageLevel
14- blas_errors:: MessageLevel
15- blas_invalid_args:: MessageLevel
16- blas_info:: MessageLevel
17- blas_success:: MessageLevel
18- condition_number:: MessageLevel
8+ using_iterative_solvers
9+ using_IterativeSolvers
10+ IterativeSolvers_iterations
11+ KrylovKit_verbosity
12+ KrylovJL_verbosity
13+ HYPRE_verbosity
14+ pardiso_verbosity
15+ blas_errors
16+ blas_invalid_args
17+ blas_info
18+ blas_success
19+ condition_number
20+ end
1921
20- function LinearVerbosity {true} (;
22+ function LinearVerbosity {true} (;
2123 # Error control defaults
2224 default_lu_fallback = WarnLevel (),
2325 # Performance defaults
@@ -35,23 +37,21 @@ mutable struct LinearVerbosity{Enabled} <: AbstractVerbositySpecifier{Enabled}
3537 blas_info = Silent (),
3638 blas_success = Silent (),
3739 condition_number = Silent ())
40+ LinearVerbosity {true} (default_lu_fallback, no_right_preconditioning,
41+ using_iterative_solvers, using_IterativeSolvers,
42+ IterativeSolvers_iterations, KrylovKit_verbosity,
43+ KrylovJL_verbosity, HYPRE_verbosity, pardiso_verbosity,
44+ blas_errors, blas_invalid_args, blas_info, blas_success, condition_number)
45+ end
3846
39- new {true} (default_lu_fallback, no_right_preconditioning,
40- using_iterative_solvers, using_IterativeSolvers,
41- IterativeSolvers_iterations, KrylovKit_verbosity,
42- KrylovJL_verbosity, HYPRE_verbosity, pardiso_verbosity,
43- blas_errors, blas_invalid_args, blas_info, blas_success, condition_number)
44- end
4547
46- function LinearVerbosity {false} ()
47- new {false} (Silent (), Silent (),
48+ function LinearVerbosity {false} ()
49+ LinearVerbosity {false} (Silent (), Silent (),
4850 Silent (), Silent (),
4951 Silent (), Silent (),
5052 Silent (), Silent (), Silent (),
5153 Silent (), Silent (), Silent (), Silent (), Silent ())
52- end
5354end
54-
5555LinearVerbosity (enabled:: Bool ) = enabled ? LinearVerbosity {true} () : LinearVerbosity {false} ()
5656
5757function LinearVerbosity (verbose:: VerbosityPreset )
@@ -121,23 +121,23 @@ end
121121
122122function LinearVerbosity (; error_control= nothing , performance= nothing , numerical= nothing , kwargs... )
123123 # Validate group arguments
124- if error_control != = nothing && ! (error_control isa MessageLevel )
125- throw (ArgumentError (" error_control must be a SciMLLogging.MessageLevel , got $(typeof (error_control)) " ))
124+ if error_control != = nothing && ! (error_control isa AbstractMessageLevel )
125+ throw (ArgumentError (" error_control must be a SciMLLogging.AbstractMessageLevel , got $(typeof (error_control)) " ))
126126 end
127- if performance != = nothing && ! (performance isa MessageLevel )
128- throw (ArgumentError (" performance must be a SciMLLogging.MessageLevel , got $(typeof (performance)) " ))
127+ if performance != = nothing && ! (performance isa AbstractMessageLevel )
128+ throw (ArgumentError (" performance must be a SciMLLogging.AbstractMessageLevel , got $(typeof (performance)) " ))
129129 end
130- if numerical != = nothing && ! (numerical isa MessageLevel )
131- throw (ArgumentError (" numerical must be a SciMLLogging.MessageLevel , got $(typeof (numerical)) " ))
130+ if numerical != = nothing && ! (numerical isa AbstractMessageLevel )
131+ throw (ArgumentError (" numerical must be a SciMLLogging.AbstractMessageLevel , got $(typeof (numerical)) " ))
132132 end
133133
134134 # Validate individual kwargs
135135 for (key, value) in kwargs
136136 if ! (key in error_control_options || key in performance_options || key in numerical_options)
137137 throw (ArgumentError (" Unknown verbosity option: $key . Valid options are: $(tuple (error_control_options... , performance_options... , numerical_options... )) " ))
138138 end
139- if ! (value isa MessageLevel )
140- throw (ArgumentError (" $key must be a SciMLLogging.MessageLevel , got $(typeof (value)) " ))
139+ if ! (value isa AbstractMessageLevel )
140+ throw (ArgumentError (" $key must be a SciMLLogging.AbstractMessageLevel , got $(typeof (value)) " ))
141141 end
142142 end
143143
@@ -222,47 +222,6 @@ function group_options(verbosity::LinearVerbosity, group::Symbol)
222222 end
223223end
224224
225- function Base. setproperty! (verbosity:: LinearVerbosity , name:: Symbol , value)
226- # Check if this is a group name
227- if name === :error_control
228- if value isa MessageLevel
229- for opt in error_control_options
230- setfield! (verbosity, opt, value)
231- end
232- else
233- error (" error_control must be set to a SciMLLogging.MessageLevel" )
234- end
235- elseif name === :performance
236- if value isa MessageLevel
237- for opt in performance_options
238- setfield! (verbosity, opt, value)
239- end
240- else
241- error (" performance must be set to a SciMLLogging.MessageLevel" )
242- end
243- elseif name === :numerical
244- if value isa MessageLevel
245- for opt in numerical_options
246- setfield! (verbosity, opt, value)
247- end
248- else
249- error (" numerical must be set to a SciMLLogging.MessageLevel" )
250- end
251- else
252- # Check if this is an individual option
253- if name in error_control_options || name in performance_options || name in numerical_options
254- if value isa MessageLevel
255- setfield! (verbosity, name, value)
256- else
257- error (" $name must be set to a SciMLLogging.MessageLevel" )
258- end
259- else
260- # Fall back to default behavior for unknown properties
261- setfield! (verbosity, name, value)
262- end
263- end
264- end
265-
266225function Base. getproperty (verbosity:: LinearVerbosity , name:: Symbol )
267226 # Check if this is a group name
268227 if name === :error_control
0 commit comments