Skip to content

Commit 3f03689

Browse files
committed
fix imports for new SciMLLogging version
1 parent ca0e50c commit 3f03689

File tree

1 file changed

+105
-105
lines changed

1 file changed

+105
-105
lines changed

src/verbosity.jl

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
mutable struct LinearVerbosity{Enabled} <: AbstractVerbositySpecifier{Enabled}
22
# Error control
3-
default_lu_fallback::SciMLLogging.LogLevel
3+
default_lu_fallback::MessageLevel
44
# Performance
5-
no_right_preconditioning::SciMLLogging.LogLevel
5+
no_right_preconditioning::MessageLevel
66
# Numerical
7-
using_iterative_solvers::SciMLLogging.LogLevel
8-
using_IterativeSolvers::SciMLLogging.LogLevel
9-
IterativeSolvers_iterations::SciMLLogging.LogLevel
10-
KrylovKit_verbosity::SciMLLogging.LogLevel
11-
KrylovJL_verbosity::SciMLLogging.LogLevel
12-
HYPRE_verbosity::SciMLLogging.LogLevel
13-
pardiso_verbosity::SciMLLogging.LogLevel
14-
blas_errors::SciMLLogging.LogLevel
15-
blas_invalid_args::SciMLLogging.LogLevel
16-
blas_info::SciMLLogging.LogLevel
17-
blas_success::SciMLLogging.LogLevel
18-
condition_number::SciMLLogging.LogLevel
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
1919

2020
function LinearVerbosity{true}(;
2121
# Error control defaults
22-
default_lu_fallback = SciMLLogging.Warn(),
22+
default_lu_fallback = WarnLevel(),
2323
# Performance defaults
24-
no_right_preconditioning = SciMLLogging.Warn(),
24+
no_right_preconditioning = WarnLevel(),
2525
# Numerical defaults
26-
using_iterative_solvers = SciMLLogging.Warn(),
27-
using_IterativeSolvers = SciMLLogging.Warn(),
28-
IterativeSolvers_iterations = SciMLLogging.Warn(),
29-
KrylovKit_verbosity = SciMLLogging.Warn(),
30-
KrylovJL_verbosity = SciMLLogging.Silent(),
31-
HYPRE_verbosity = SciMLLogging.Info(),
32-
pardiso_verbosity = SciMLLogging.Silent(),
33-
blas_errors = SciMLLogging.Warn(),
34-
blas_invalid_args = SciMLLogging.Warn(),
35-
blas_info = SciMLLogging.Silent(),
36-
blas_success = SciMLLogging.Silent(),
37-
condition_number = SciMLLogging.Silent())
26+
using_iterative_solvers = WarnLevel(),
27+
using_IterativeSolvers = WarnLevel(),
28+
IterativeSolvers_iterations = WarnLevel(),
29+
KrylovKit_verbosity = WarnLevel(),
30+
KrylovJL_verbosity = Silent(),
31+
HYPRE_verbosity = InfoLevel(),
32+
pardiso_verbosity = Silent(),
33+
blas_errors = WarnLevel(),
34+
blas_invalid_args = WarnLevel(),
35+
blas_info = Silent(),
36+
blas_success = Silent(),
37+
condition_number = Silent())
3838

3939
new{true}(default_lu_fallback, no_right_preconditioning,
4040
using_iterative_solvers, using_IterativeSolvers,
@@ -44,11 +44,11 @@ mutable struct LinearVerbosity{Enabled} <: AbstractVerbositySpecifier{Enabled}
4444
end
4545

4646
function LinearVerbosity{false}()
47-
new{false}(SciMLLogging.Silent(), SciMLLogging.Silent(),
48-
SciMLLogging.Silent(), SciMLLogging.Silent(),
49-
SciMLLogging.Silent(), SciMLLogging.Silent(),
50-
SciMLLogging.Silent(), SciMLLogging.Silent(), SciMLLogging.Silent(),
51-
SciMLLogging.Silent(), SciMLLogging.Silent(), SciMLLogging.Silent(), SciMLLogging.Silent(), SciMLLogging.Silent())
47+
new{false}(Silent(), Silent(),
48+
Silent(), Silent(),
49+
Silent(), Silent(),
50+
Silent(), Silent(), Silent(),
51+
Silent(), Silent(), Silent(), Silent(), Silent())
5252
end
5353
end
5454

@@ -59,56 +59,56 @@ function LinearVerbosity(verbose::SciMLLogging.VerbosityPreset)
5959
LinearVerbosity{false}()
6060
elseif verbose isa SciMLLogging.All
6161
LinearVerbosity{true}(
62-
default_lu_fallback = SciMLLogging.Info(),
63-
no_right_preconditioning = SciMLLogging.Info(),
64-
using_iterative_solvers = SciMLLogging.Info(),
65-
using_IterativeSolvers = SciMLLogging.Info(),
66-
IterativeSolvers_iterations = SciMLLogging.Info(),
67-
KrylovKit_verbosity = SciMLLogging.Info(),
68-
KrylovJL_verbosity = SciMLLogging.Info(),
69-
HYPRE_verbosity = SciMLLogging.Info(),
70-
pardiso_verbosity = SciMLLogging.Info(),
71-
blas_errors = SciMLLogging.Info(),
72-
blas_invalid_args = SciMLLogging.Info(),
73-
blas_info = SciMLLogging.Info(),
74-
blas_success = SciMLLogging.Info(),
75-
condition_number = SciMLLogging.Info()
62+
default_lu_fallback = InfoLevel(),
63+
no_right_preconditioning = InfoLevel(),
64+
using_iterative_solvers = InfoLevel(),
65+
using_IterativeSolvers = InfoLevel(),
66+
IterativeSolvers_iterations = InfoLevel(),
67+
KrylovKit_verbosity = InfoLevel(),
68+
KrylovJL_verbosity = InfoLevel(),
69+
HYPRE_verbosity = InfoLevel(),
70+
pardiso_verbosity = InfoLevel(),
71+
blas_errors = InfoLevel(),
72+
blas_invalid_args = InfoLevel(),
73+
blas_info = InfoLevel(),
74+
blas_success = InfoLevel(),
75+
condition_number = InfoLevel()
7676
)
7777
elseif verbose isa SciMLLogging.Minimal
7878
LinearVerbosity{true}(
79-
default_lu_fallback = SciMLLogging.Error(),
80-
no_right_preconditioning = SciMLLogging.Silent(),
81-
using_iterative_solvers = SciMLLogging.Silent(),
82-
using_IterativeSolvers = SciMLLogging.Silent(),
83-
IterativeSolvers_iterations = SciMLLogging.Silent(),
84-
KrylovKit_verbosity = SciMLLogging.Silent(),
85-
KrylovJL_verbosity = SciMLLogging.Silent(),
86-
HYPRE_verbosity = SciMLLogging.Silent(),
87-
pardiso_verbosity = SciMLLogging.Silent(),
88-
blas_errors = SciMLLogging.Error(),
89-
blas_invalid_args = SciMLLogging.Error(),
90-
blas_info = SciMLLogging.Silent(),
91-
blas_success = SciMLLogging.Silent(),
92-
condition_number = SciMLLogging.Silent()
79+
default_lu_fallback = ErrorLevel(),
80+
no_right_preconditioning = Silent(),
81+
using_iterative_solvers = Silent(),
82+
using_IterativeSolvers = Silent(),
83+
IterativeSolvers_iterations = Silent(),
84+
KrylovKit_verbosity = Silent(),
85+
KrylovJL_verbosity = Silent(),
86+
HYPRE_verbosity = Silent(),
87+
pardiso_verbosity = Silent(),
88+
blas_errors = ErrorLevel(),
89+
blas_invalid_args = ErrorLevel(),
90+
blas_info = Silent(),
91+
blas_success = Silent(),
92+
condition_number = Silent()
9393
)
9494
elseif verbose isa SciMLLogging.Standard
9595
LinearVerbosity{true}() # Use default settings
9696
elseif verbose isa SciMLLogging.Detailed
9797
LinearVerbosity{true}(
98-
default_lu_fallback = SciMLLogging.Info(),
99-
no_right_preconditioning = SciMLLogging.Info(),
100-
using_iterative_solvers = SciMLLogging.Info(),
101-
using_IterativeSolvers = SciMLLogging.Info(),
102-
IterativeSolvers_iterations = SciMLLogging.Info(),
103-
KrylovKit_verbosity = SciMLLogging.Warn(),
104-
KrylovJL_verbosity = SciMLLogging.Warn(),
105-
HYPRE_verbosity = SciMLLogging.Info(),
106-
pardiso_verbosity = SciMLLogging.Warn(),
107-
blas_errors = SciMLLogging.Warn(),
108-
blas_invalid_args = SciMLLogging.Warn(),
109-
blas_info = SciMLLogging.Info(),
110-
blas_success = SciMLLogging.Info(),
111-
condition_number = SciMLLogging.Info()
98+
default_lu_fallback = InfoLevel(),
99+
no_right_preconditioning = InfoLevel(),
100+
using_iterative_solvers = InfoLevel(),
101+
using_IterativeSolvers = InfoLevel(),
102+
IterativeSolvers_iterations = InfoLevel(),
103+
KrylovKit_verbosity = WarnLevel(),
104+
KrylovJL_verbosity = WarnLevel(),
105+
HYPRE_verbosity = InfoLevel(),
106+
pardiso_verbosity = WarnLevel(),
107+
blas_errors = WarnLevel(),
108+
blas_invalid_args = WarnLevel(),
109+
blas_info = InfoLevel(),
110+
blas_success = InfoLevel(),
111+
condition_number = InfoLevel()
112112
)
113113
else
114114
LinearVerbosity{true}() # Default fallback
@@ -121,42 +121,42 @@ end
121121

122122
function LinearVerbosity(; error_control=nothing, performance=nothing, numerical=nothing, kwargs...)
123123
# Validate group arguments
124-
if error_control !== nothing && !(error_control isa SciMLLogging.LogLevel)
125-
throw(ArgumentError("error_control must be a SciMLLogging.LogLevel, got $(typeof(error_control))"))
124+
if error_control !== nothing && !(error_control isa MessageLevel)
125+
throw(ArgumentError("error_control must be a SciMLLogging.MessageLevel, got $(typeof(error_control))"))
126126
end
127-
if performance !== nothing && !(performance isa SciMLLogging.LogLevel)
128-
throw(ArgumentError("performance must be a SciMLLogging.LogLevel, got $(typeof(performance))"))
127+
if performance !== nothing && !(performance isa MessageLevel)
128+
throw(ArgumentError("performance must be a SciMLLogging.MessageLevel, got $(typeof(performance))"))
129129
end
130-
if numerical !== nothing && !(numerical isa SciMLLogging.LogLevel)
131-
throw(ArgumentError("numerical must be a SciMLLogging.LogLevel, got $(typeof(numerical))"))
130+
if numerical !== nothing && !(numerical isa MessageLevel)
131+
throw(ArgumentError("numerical must be a SciMLLogging.MessageLevel, 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 SciMLLogging.LogLevel)
140-
throw(ArgumentError("$key must be a SciMLLogging.LogLevel, got $(typeof(value))"))
139+
if !(value isa MessageLevel)
140+
throw(ArgumentError("$key must be a SciMLLogging.MessageLevel, got $(typeof(value))"))
141141
end
142142
end
143143

144144
# Build arguments using NamedTuple for type stability
145145
default_args = (
146-
default_lu_fallback = SciMLLogging.Warn(),
147-
no_right_preconditioning = SciMLLogging.Warn(),
148-
using_iterative_solvers = SciMLLogging.Warn(),
149-
using_IterativeSolvers = SciMLLogging.Warn(),
150-
IterativeSolvers_iterations = SciMLLogging.Warn(),
151-
KrylovKit_verbosity = SciMLLogging.Warn(),
152-
KrylovJL_verbosity = SciMLLogging.Silent(),
153-
HYPRE_verbosity = SciMLLogging.Info(),
154-
pardiso_verbosity = SciMLLogging.Silent(),
155-
blas_errors = SciMLLogging.Warn(),
156-
blas_invalid_args = SciMLLogging.Warn(),
157-
blas_info = SciMLLogging.Silent(),
158-
blas_success = SciMLLogging.Silent(),
159-
condition_number = SciMLLogging.Silent()
146+
default_lu_fallback = WarnLevel(),
147+
no_right_preconditioning = WarnLevel(),
148+
using_iterative_solvers = WarnLevel(),
149+
using_IterativeSolvers = WarnLevel(),
150+
IterativeSolvers_iterations = WarnLevel(),
151+
KrylovKit_verbosity = WarnLevel(),
152+
KrylovJL_verbosity = Silent(),
153+
HYPRE_verbosity = InfoLevel(),
154+
pardiso_verbosity = Silent(),
155+
blas_errors = WarnLevel(),
156+
blas_invalid_args = WarnLevel(),
157+
blas_info = Silent(),
158+
blas_success = Silent(),
159+
condition_number = Silent()
160160
)
161161

162162
# Apply group-level settings
@@ -225,36 +225,36 @@ end
225225
function Base.setproperty!(verbosity::LinearVerbosity, name::Symbol, value)
226226
# Check if this is a group name
227227
if name === :error_control
228-
if value isa SciMLLogging.LogLevel
228+
if value isa MessageLevel
229229
for opt in error_control_options
230230
setfield!(verbosity, opt, value)
231231
end
232232
else
233-
error("error_control must be set to a SciMLLogging.LogLevel")
233+
error("error_control must be set to a SciMLLogging.MessageLevel")
234234
end
235235
elseif name === :performance
236-
if value isa SciMLLogging.LogLevel
236+
if value isa MessageLevel
237237
for opt in performance_options
238238
setfield!(verbosity, opt, value)
239239
end
240240
else
241-
error("performance must be set to a SciMLLogging.LogLevel")
241+
error("performance must be set to a SciMLLogging.MessageLevel")
242242
end
243243
elseif name === :numerical
244-
if value isa SciMLLogging.LogLevel
244+
if value isa MessageLevel
245245
for opt in numerical_options
246246
setfield!(verbosity, opt, value)
247247
end
248248
else
249-
error("numerical must be set to a SciMLLogging.LogLevel")
249+
error("numerical must be set to a SciMLLogging.MessageLevel")
250250
end
251251
else
252252
# Check if this is an individual option
253253
if name in error_control_options || name in performance_options || name in numerical_options
254-
if value isa SciMLLogging.LogLevel
254+
if value isa MessageLevel
255255
setfield!(verbosity, name, value)
256256
else
257-
error("$name must be set to a SciMLLogging.LogLevel")
257+
error("$name must be set to a SciMLLogging.MessageLevel")
258258
end
259259
else
260260
# Fall back to default behavior for unknown properties

0 commit comments

Comments
 (0)