1818
1919function LinearErrorControlVerbosity (verbose:: Verbosity.Type )
2020 @match verbose begin
21- Verbosity. None () => LinearErrorControlVerbosity (fill (Verbosity. None (), nfields ( LinearErrorControlVerbosity))... )
21+ Verbosity. None () => LinearErrorControlVerbosity (fill (Verbosity. None (), length ( fieldnames ( LinearErrorControlVerbosity) ))... )
2222
23- Verbosity. Warn () => LinearErrorControlVerbosity (fill (Verbosity. Warn (), nfields ( LinearErrorControlVerbosity))... )
23+ Verbosity. Info () => LinearErrorControlVerbosity (fill (Verbosity. Info (), length ( fieldnames ( LinearErrorControlVerbosity) ))... )
2424
25- Verbosity. Error () => LinearErrorControlVerbosity (fill (Verbosity. Error (), nfields (LinearErrorControlVerbosity))... )
25+ Verbosity. Warn () => LinearErrorControlVerbosity (fill (Verbosity. Warn (), length (fieldnames (LinearErrorControlVerbosity)))... )
26+
27+ Verbosity. Error () => LinearErrorControlVerbosity (fill (Verbosity. Error (), length (fieldnames (LinearErrorControlVerbosity)))... )
2628
2729 Verbosity. Default () => LinearErrorControlVerbosity ()
2830
4446function LinearPerformanceVerbosity (verbose:: Verbosity.Type )
4547 @match verbose begin
4648 Verbosity. None () => LinearPerformanceVerbosity (fill (
47- Verbosity. None (), nfields (LinearPerformanceVerbosity))... )
49+ Verbosity. None (), length (fieldnames (LinearPerformanceVerbosity)))... )
50+
51+ Verbosity. Info () => LinearPerformanceVerbosity (fill (
52+ Verbosity. Info (), length (fieldnames (LinearPerformanceVerbosity)))... )
4853
4954 Verbosity. Warn () => LinearPerformanceVerbosity (fill (
50- Verbosity. Warn (), nfields ( LinearPerformanceVerbosity))... )
55+ Verbosity. Warn (), length ( fieldnames ( LinearPerformanceVerbosity) ))... )
5156
5257 Verbosity. Error () => LinearPerformanceVerbosity (fill (
53- Verbosity. Error (), nfields ( LinearPerformanceVerbosity))... )
58+ Verbosity. Error (), length ( fieldnames ( LinearPerformanceVerbosity) ))... )
5459
5560 Verbosity. Default () => LinearPerformanceVerbosity ()
5661
6267
6368mutable struct LinearNumericalVerbosity
6469 @add_kwonly function LinearNumericalVerbosity ()
65- LinearNumericalVerbosity ()
70+ new ()
6671 end
6772
6873end
7176function LinearNumericalVerbosity (verbose:: Verbosity.Type )
7277 @match verbose begin
7378 Verbosity. None () => LinearNumericalVerbosity (fill (
74- Verbosity. None (), nfields (LinearNumericalVerbosity))... )
79+ Verbosity. None (), length (fieldnames (LinearNumericalVerbosity)))... )
80+
81+ Verbosity. Info () => LinearNumericalVerbosity (fill (
82+ Verbosity. Info (), length (fieldnames (LinearNumericalVerbosity)))... )
7583
7684 Verbosity. Warn () => LinearNumericalVerbosity (fill (
77- Verbosity. Warn (), nfields ( LinearNumericalVerbosity))... )
85+ Verbosity. Warn (), length ( fieldnames ( LinearNumericalVerbosity) ))... )
7886
7987 Verbosity. Error () => LinearNumericalVerbosity (fill (
80- Verbosity. Error (), nfields ( LinearNumericalVerbosity))... )
88+ Verbosity. Error (), length ( fieldnames ( LinearNumericalVerbosity) ))... )
8189
8290 Verbosity. Default () => LinearNumericalVerbosity ()
8391
@@ -87,7 +95,7 @@ function LinearNumericalVerbosity(verbose::Verbosity.Type)
8795 end
8896end
8997
90- struct LinearVerbosity{T}
98+ struct LinearVerbosity{T} <: AbstractVerbositySpecifier{T}
9199 error_control:: LinearErrorControlVerbosity
92100 performance:: LinearPerformanceVerbosity
93101 numerical:: LinearNumericalVerbosity
@@ -106,10 +114,10 @@ function LinearVerbosity(verbose::Verbosity.Type)
106114 LinearPerformanceVerbosity (Verbosity. None ()),
107115 LinearNumericalVerbosity (Verbosity. None ()))
108116
109- Verbosity. All () => ODEVerbosity {true} (
110- LinearErrorControlVerbosity (Verbosity. All ()),
111- LinearPerformanceVerbosity (Verbosity. All ()),
112- LinearNumericalVerbosity (Verbosity. All ())
117+ Verbosity. All () => LinearVerbosity {true} (
118+ LinearErrorControlVerbosity (Verbosity. Info ()),
119+ LinearPerformanceVerbosity (Verbosity. Info ()),
120+ LinearNumericalVerbosity (Verbosity. Info ())
113121 )
114122
115123 _ => @error " Not a valid choice for verbosity."
120128
121129mutable struct NonlinearErrorControlVerbosity
122130 @add_kwonly function NonlinearErrorControlVerbosity ()
123- NonlinearErrorControlVerbosity ()
131+ new ()
124132 end
125133end
126134
@@ -129,13 +137,16 @@ end
129137function NonlinearErrorControlVerbosity (verbose:: Verbosity.Type )
130138 @match verbose begin
131139 Verbosity. None () => NonlinearErrorControlVerbosity (fill (
132- Verbosity. None (), nfields (NonlinearErrorControlVerbosity))... )
140+ Verbosity. None (), length (fieldnames (NonlinearErrorControlVerbosity)))... )
141+
142+ Verbosity. Info () => NonlinearErrorControlVerbosity (fill (
143+ Verbosity. Info (), length (fieldnames (NonlinearErrorControlVerbosity)))... )
133144
134145 Verbosity. Warn () => NonlinearErrorControlVerbosity (fill (
135- Verbosity. Warn (), nfields ( NonlinearErrorControlVerbosity))... )
146+ Verbosity. Warn (), length ( fieldnames ( NonlinearErrorControlVerbosity) ))... )
136147
137148 Verbosity. Error () => NonlinearNumericalVerbosity (fill (
138- Verbosity. Error (), nfields ( NonlinearErrorControlVerbosity))... )
149+ Verbosity. Error (), length ( fieldnames ( NonlinearErrorControlVerbosity) ))... )
139150
140151 Verbosity. Default () => NonlinearErrorControlVerbosity ()
141152
@@ -156,13 +167,16 @@ end
156167function NonlinearPerformanceVerbosity (verbose:: Verbosity.Type )
157168 @match verbose begin
158169 Verbosity. None () => NonlinearPerformanceVerbosity (fill (
159- Verbosity. None (), nfields (NonlinearPerformanceVerbosity))... )
170+ Verbosity. None (), length (fieldnames (NonlinearPerformanceVerbosity)))... )
171+
172+ Verbosity. Info () => NonlinearPerformanceVerbosity (fill (
173+ Verbosity. Info (), length (fieldnames (NonlinearPerformanceVerbosity)))... )
160174
161175 Verbosity. Warn () => NonlinPerformanceVerbosity (fill (
162- Verbosity. Warn (), nfields ( NonlinearPerformanceVerbosity))... )
176+ Verbosity. Warn (), length ( fieldnames ( NonlinearPerformanceVerbosity) ))... )
163177
164178 Verbosity. Error () => NonlinearPerformanceVerbosity (fill (
165- Verbosity. Error (), nfields ( NonlinearPerformanceVerbosity))... )
179+ Verbosity. Error (), length ( fieldnames ( NonlinearPerformanceVerbosity) ))... )
166180
167181 Verbosity. Default () => NonlinearPerformanceVerbosity ()
168182
@@ -182,13 +196,16 @@ end
182196function NonlinearNumericalVerbosity (verbose:: Verbosity.Type )
183197 @match verbose begin
184198 Verbosity. None () => NonlinearNumericalVerbosity (fill (
185- Verbosity. None (), nfields (NonlinearPerformanceVerbosity))... )
199+ Verbosity. None (), length (fieldnames (NonlinearPerformanceVerbosity)))... )
200+
201+ Verbosity. Info () => NonlinearNumericalVerbosity (fill (
202+ Verbosity. Info (), length (fieldnames (NonlinearPerformanceVerbosity)))... )
186203
187204 Verbosity. Warn () => NonlinearNumericalVerbosity (fill (
188- Verbosity. Warn (), nfields ( NonlinearPerformanceVerbosity))... )
205+ Verbosity. Warn (), length ( fieldnames ( NonlinearPerformanceVerbosity) ))... )
189206
190207 Verbosity. Error () => NonlinearNumericalVerbosity (fill (
191- Verbosity. Error (), nfields ( NonlinearPerformanceVerbosity))... )
208+ Verbosity. Error (), length ( fieldnames ( NonlinearPerformanceVerbosity) ))... )
192209
193210 Verbosity. Default () => NonlinearNumericalVerbosity ()
194211
@@ -198,7 +215,7 @@ function NonlinearNumericalVerbosity(verbose::Verbosity.Type)
198215 end
199216end
200217
201- struct NonlinearVerbosity{T}
218+ struct NonlinearVerbosity{T} <: AbstractVerbositySpecifier{T}
202219 linear_verbosity:: LinearVerbosity
203220
204221 error_control:: NonlinearErrorControlVerbosity
@@ -221,11 +238,11 @@ function NonlinearVerbosity(verbose::Verbosity.Type)
221238 NonlinearPerformanceVerbosity (Verbosity. None ()),
222239 NonlinearNumericalVerbosity (Verbosity. None ()))
223240
224- Verbosity. All () => ODEVerbosity {true} (
241+ Verbosity. All () => NonlinearVerbosity {true} (
225242 LinearVerbosity (Verbosity. All ()),
226- NonlinearErrorControlVerbosity (Verbosity. All ()),
227- NonlinearPerformanceVerbosity (Verbosity. All ()),
228- NonlinearNumericalVerbosity (Verbosity. All ())
243+ NonlinearErrorControlVerbosity (Verbosity. Info ()),
244+ NonlinearPerformanceVerbosity (Verbosity. Info ()),
245+ NonlinearNumericalVerbosity (Verbosity. Info ())
229246 )
230247
231248 _ => @error " Not a valid choice for verbosity."
@@ -248,13 +265,16 @@ end
248265function ODEErrorControlVerbosity (verbose:: Verbosity.Type )
249266 @match verbose begin
250267 Verbosity. None () => ODEErrorControlVerbosity (fill (
251- Verbosity. None (), nfields (ODEErrorControlVerbosity))... )
268+ Verbosity. None (), length (fieldnames (ODEErrorControlVerbosity)))... )
269+
270+ Verbosity. Info () => ODEErrorControlVerbosity (fill (
271+ Verbosity. Info (), length (fieldnames (ODEErrorControlVerbosity)))... )
252272
253273 Verbosity. Warn () => ODEErrorControlVerbosity (fill (
254- Verbosity. Warn (), nfields ( ODEErrorControlVerbosity))... )
274+ Verbosity. Warn (), length ( fieldnames ( ODEErrorControlVerbosity) ))... )
255275
256276 Verbosity. Error () => ODEErrorControlVerbosity (fill (
257- Verbosity. Error (), nfields ( ODEErrorControlVerbosity))... )
277+ Verbosity. Error (), length ( fieldnames ( ODEErrorControlVerbosity) ))... )
258278
259279 Verbosity. Default () => ODEErrorControlVerbosity (Verbosity. Info (), Verbosity. Error ())
260280
@@ -265,8 +285,8 @@ function ODEErrorControlVerbosity(verbose::Verbosity.Type)
265285end
266286
267287mutable struct ODEPerformanceVerbosity
268- @add_kwonly function ODEPerformanceVerbosity (dt_NaN, init_NaN )
269- new (dt_NaN, init_NaN )
288+ @add_kwonly function ODEPerformanceVerbosity ()
289+ new ()
270290 end
271291end
272292
@@ -275,13 +295,16 @@ end
275295function ODEPerformanceVerbosity (verbose:: Verbosity.Type )
276296 @match verbose begin
277297 Verbosity. None () => ODEPerformanceVerbosity (fill (
278- Verbosity. None (), nfields (ODEPerformanceVerbosity))... )
298+ Verbosity. None (), length (fieldnames (ODEPerformanceVerbosity)))... )
299+
300+ Verbosity. Info () => ODEPerformanceVerbosity (fill (
301+ Verbosity. Info (), length (fieldnames (ODEPerformanceVerbosity)))... )
279302
280303 Verbosity. Warn () => ODEPerformanceVerbosity (fill (
281- Verbosity. Warn (), nfields ( ODEPerformanceVerbosity))... )
304+ Verbosity. Warn (), length ( fieldnames ( ODEPerformanceVerbosity) ))... )
282305
283306 Verbosity. Error () => ODEPerformanceVerbosity (fill (
284- Verbosity. Error (), nfields ( ODEPerformanceVerbosity))... )
307+ Verbosity. Error (), length ( fieldnames ( ODEPerformanceVerbosity) ))... )
285308
286309 Verbosity. Default () => ODEPerformanceVerbosity ()
287310
@@ -290,8 +313,8 @@ function ODEPerformanceVerbosity(verbose::Verbosity.Type)
290313end
291314
292315mutable struct ODENumericalVerbosity
293- @add_kwonly function ODENumericalVerbosity (dt_NaN, init_NaN )
294- new (dt_NaN, init_NaN )
316+ @add_kwonly function ODENumericalVerbosity ()
317+ new ()
295318 end
296319end
297320
@@ -300,23 +323,26 @@ end
300323function ODENumericalVerbosity (verbose:: Verbosity.Type )
301324 @match verbose begin
302325 Verbosity. None () => ODENumericalVerbosity (fill (
303- Verbosity. None (), nfields (ODENumericalVerbosity))... )
326+ Verbosity. None (), length (fieldnames (ODENumericalVerbosity)))... )
327+
328+ Verbosity. Info () => ODENumericalVerbosity (fill (
329+ Verbosity. None (), length (fieldnames (ODENumericalVerbosity)))... )
304330
305331 Verbosity. Warn () => ODENumericalVerbosity (fill (
306- Verbosity. Warn (), nfields ( ODENumericalVerbosity))... )
332+ Verbosity. Warn (), length ( fieldnames ( ODENumericalVerbosity) ))... )
307333
308334 Verbosity. Error () => ODENumericalVerbosity (fill (
309- Verbosity. Error (), nfields ( ODENumericalVerbosity))... )
335+ Verbosity. Error (), length ( fieldnames ( ODENumericalVerbosity) ))... )
310336
311337 Verbosity. Default () => ODENumericalVerbosity ()
312338
313339 _ => @error " Not a valid choice for verbosity."
314340 end
315341end
316342
317- struct ODEVerbosity{T}
318- nonlinear_verbosity:: NonlinearVerbosity
343+ struct ODEVerbosity{T} <: AbstractVerbositySpecifier{T}
319344 linear_verbosity:: LinearVerbosity
345+ nonlinear_verbosity:: NonlinearVerbosity
320346
321347 error_control:: ODEErrorControlVerbosity
322348 performance:: ODEPerformanceVerbosity
@@ -344,9 +370,9 @@ function ODEVerbosity(verbose::Verbosity.Type)
344370 Verbosity. All () => ODEVerbosity {true} (
345371 LinearVerbosity (Verbosity. All ()),
346372 NonlinearVerbosity (Verbosity. All ()),
347- ODEErrorControlVerbosity (Verbosity. All ()),
348- ODEPerformanceVerbosity (Verbosity. All ()),
349- ODENumericalVerbosity (Verbosity. All ())
373+ ODEErrorControlVerbosity (Verbosity. Info ()),
374+ ODEPerformanceVerbosity (Verbosity. Info ()),
375+ ODENumericalVerbosity (Verbosity. Info ())
350376 )
351377
352378 _ => @error " Not a valid choice for verbosity."
@@ -385,7 +411,7 @@ function ODEVerbosity(; error_control = Verbosity.Default(), performance = Verbo
385411 nonlinear = nonlinear_verbosity
386412 end
387413
388- ODEVerbosity (nonlinear, linear , error_control_verbosity, performance_verbosity, numerical_verbosity)
414+ ODEVerbosity {true} (linear, nonlinear , error_control_verbosity, performance_verbosity, numerical_verbosity)
389415end
390416
391417
@@ -405,17 +431,18 @@ function message_level(verbose::AbstractVerbositySpecifier{true}, option, group)
405431end
406432
407433function emit_message (
408- f:: Function , verbose:: AbstractVerbositySpecifier{true} , option, group, file, line, _module)
409- level = message_level (verbose, option, group)
434+ f:: Function , verbose:: V , option, group, file, line, _module) where {V<: AbstractVerbositySpecifier{true} }
410435
436+ level = message_level (
437+ verbose, option, group)
411438 if ! isnothing (level)
412439 message = f ()
413440 Base. @logmsg level message _file= file _line= line _module= _module
414441 end
415442end
416443
417- function emit_message (message:: String , verbose:: AbstractVerbositySpecifier{true} ,
418- option, group, file, line, _module)
444+ function emit_message (message:: String , verbose:: V ,
445+ option, group, file, line, _module) where {V <: AbstractVerbositySpecifier{true} }
419446 level = message_level (verbose, option, group)
420447
421448 if ! isnothing (level)
@@ -454,5 +481,5 @@ macro SciMLMessage(f_or_message, verb, option, group)
454481 file = string (__source__. file)
455482 _module = __module__
456483 return :(emit_message (
457- $ (esc (f_or_message)), $ (esc (verb)), $ toggle , $ group, $ file, $ line, $ _module))
484+ $ (esc (f_or_message)), $ (esc (verb)), $ option , $ group, $ file, $ line, $ _module))
458485end
0 commit comments