Skip to content

Conversation

jClugstor
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

@jClugstor
Copy link
Member Author

@ChrisRackauckas I think these are better

Comment on lines 11 to 13
3. Log levels - Predefined log levels (`Silent`, `InfoLevel`, `WarnLevel`, `ErrorLevel`, `CustomLevel(n)`)
4. Verbosity preset levels - `None`, `Minimal`, `Standard`, `Detailed`, `All`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain this a bit. It sounds redundant without more information. What happens if you use both? Etc.

Comment on lines 17 to 19
- Type parameter T: Controls whether logging is enabled (T=true) or disabled (T=false). When `T = false`, any use of the `SciMLLogging.emit_message` function points to any empty function. When the the type parameter is known at compile time, this allows for the compiler to make certain optimizations that can lead to this system having zero runtime overhead when not in use.
- Message levels: Fields of the `AbstractVerbositySpecifier` represent messages or groups of messages. These fields should be of the type `SciMLLogging.MessageLevel`. Each message level subtype represents a different level at which the message will be logged at.
### @SciMLMessage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense. Can you share an example?

```

This example shows the minimal structure needed to integrate SciMLLogging into a package.
This example shows the minimal structure needed to integrate SciMLLogging into a package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tutorial starts here? Why is there effectively a manual page on the top of the tutorial? Why isn't there a manual page for the manual page information?

This example shows the minimal structure needed to integrate SciMLLogging into a package.
This example shows the minimal structure needed to integrate SciMLLogging into a package.

## Utility Functions for Integration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is manual page information... why is this here??????

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll set up a separate manual page and put this stuff there.

Comment on lines 240 to 269
### `verbosity_to_int()`

Converts a `MessageLevel` to an integer value. This is useful when interfacing with packages that use integer-based verbosity levels:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is docstring information. Why is it not in a docstring?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the docstring for verbosity_to_int

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why is it copied? You already violated the standard style by just making an API page, instead there just needs to be a manual page where the right docstrings have the right information around it, rather than just dumping docstrings in a random order with no context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't create the api.md file, that was Claude c147cab

I'll take a look at the Documentation part of the SciML style guide and fix these up

- **`T` parameter**: Controls whether logging is enabled (`T=true`) or disabled (`T=false`)
- **Each field**: Represents a category of messages the package can emit
- **MessageLevel values**: Can be `Silent()`, `InfoLevel()`, `WarnLevel()`, `ErrorLevel()`, or `CustomLevel(n)` for custom levels
- **`T` parameter**: Controls whether logging is enabled (`T=true`) or disabled (`T=false`) for all messages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a T if there's also the message levels? Why wouldn't you just construct with all Silent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the T there allowed the actual construction of the LinearVerbosity object to be compiled out in earlier iterations. Moving to the types for all of the levels seems to have broken that but I thought it might be useful to keep around in case I can get that working again.

It's not strictly necessary to make it work, so I could get rid of it.

Comment on lines 26 to 30
- `Silent()` : no message is emitted
- `InfoLevel()` : message is emitted as an `Info` log
- `WarnLevel()` : message is emitted as a `Warn` log
- `ErrorLevel()` : message is emitted as an `Error` log
- `CustomLevel(n)` : message is emitted at `LogLevel(n)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these types? How does ::MessageLevel work then? Don't those all have to be MessageLevel?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... this is misnamed... https://github.com/SciML/SciMLLogging.jl/blob/main/src/verbosity.jl#L13 this kind of stuff really shouldn't need iterations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misnamed how exactly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractMessageLevel

Comment on lines 16 to 18
initialization::MessageLevel # Controls startup messages
iterations::MessageLevel # Controls per-iteration output
convergence::MessageLevel # Controls convergence messages
warnings::MessageLevel # Controls warning messages
error_control::MessageLevel # Controls messages about solver error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this be uninferred?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly since MessageLevel is an abstract type. I had no issues when testing LinearVerbosity with it set up like this though, JET tests pass etc. though we can change it to be all concrete and maybe we should.

Really this is up to whoever is implementing the AbstractVerbositySpecifier, the fields just need to be <: MessageLevel to be compatible with the macro.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be made concrete though, otherwise it won't compile out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging code can still be compiled out when Silent() is used, even if they aren't concrete, I show it here: SciML/LinearSolve.jl#756 (comment)

But yeah only reason not to make it concrete is to be able to change logging levels with setproperty!, which was a request someone had. But that's not really that important

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No supporting setproperty with this is a bad idea.

- `ErrorLevel()` : message is emitted as an `Error` log
- `CustomLevel(n)` : message is emitted at `LogLevel(n)`

When `T=false`, all logging is disabled with zero runtime overhead. When `T=true`, each category can be individually controlled.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this exist if there are presets?


Here's an example of how one might use a packages `AbstractVerbositySpecifier` implementation to control the output.

Here's an example of how one might use a packages `AbstractVerbositySpecifier` implementation to control the output, using the same `SolverVerbosity` type as above.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the main way people use this be via Presets? So why are the details coming before the simple use case?

Note: You need to restart Julia after changing the backend preference in order to use the chosen backend.


## Common Scenarios
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is just redundant information.

@jClugstor jClugstor force-pushed the tutorial_updates branch 2 times, most recently from ec79818 to fc6397c Compare September 29, 2025 22:07
@jClugstor
Copy link
Member Author

  • Added manual page with docstrings for every feature of the package
  • streamlined the getting started page
  • made the tutorials less verbose, included some actual runnable examples
    @ChrisRackauckas does this look better?

Comment on lines 30 to 36

**Available Presets:**
- `None()`: No output at all (zero overhead)
- `Minimal()`: Only essential messages and warnings
- `Standard()`: Balanced verbosity for typical usage
- `Detailed()`: Comprehensive information for debugging
- `All()`: Maximum verbosity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Available Presets:**
- `None()`: No output at all (zero overhead)
- `Minimal()`: Only essential messages and warnings
- `Standard()`: Balanced verbosity for typical usage
- `Detailed()`: Comprehensive information for debugging
- `All()`: Maximum verbosity

@jClugstor
Copy link
Member Author

@ChrisRackauckas anything else?

@ChrisRackauckas
Copy link
Member

It's still missing the main manual page.


Use `Minimal` when you want to be informed of important issues but don't need detailed progress information.

**What to include at each level:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**What to include at each level:**
**What to include at this level:**

Comment on lines 35 to 38
**Typical message categories:**
- Errors: `ErrorLevel()`
- Warnings: `WarnLevel()`
- Everything else: `Silent()`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is meant more for the people implementing the presets. I wanted to give a rough idea of what log levels should be included each preset, and what should be silent.

So for the Minimal preset, you would only want errors and warnings to show up in the logs, and you would want to log them at the error level and the warning level. Then all other informational things should be silent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I know that's what it's for, but it's not understandable. Why not just write a normal sentence?

Use `Minimal` when you want to be informed of important issues but don't need detailed progress information.

**What to include at each level:**
- **WarnLevel or higher**: Warnings about potential issues (e.g., convergence problems, parameter choices that may affect results, deprecated features)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better if this kind of stuff is in the docstrings for each preset?


**What to include at each level:**
- **WarnLevel or higher**: Warnings about potential issues (e.g., convergence problems, parameter choices that may affect results, deprecated features)
- **ErrorLevel**: Critical failures and errors that stop computation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so? What else would we want to use ErrorLevel for?

Comment on lines 48 to 50
- **InfoLevel or higher**: Important initialization messages (e.g., algorithm selection, key parameter values), significant milestones, convergence status, final results, warnings, and errors
- **WarnLevel or higher**: All warnings and errors as in `Minimal`
- **ErrorLevel**: All critical failures
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied? Is there a reason to not just say it has all of below and?

@ChrisRackauckas
Copy link
Member

It is completely not understandable what should be in each level. Try again. Is that Claude because it's really bad? This is really wasting time to have me review your Claude output without you ever reading it.

@jClugstor
Copy link
Member Author

Not trying to waste your time. These made sense in my head, good to know they were confusing.

I moved the descriptions of what each preset should have in to the docstrings, and made them read more like a sentence. Hopefully they make more sense now.

Also let me know your opinion on #29. If we want ErrorLevel to throw an error that of course should be documented as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs examples of what kinds of things would go into each category.


The `All` preset enables maximum verbosity, useful for deep debugging or understanding complex behaviors.

## Custom Presets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work? It doesn't dispatch?

src/verbosity.jl Outdated
This verbosity preset should include the settings from `Minimal`, while also setting
messages such as important initialization messages (e.g., algorithm selection, key parameter values),
significant milestones, convergence status, final results to `InfoLevel()` or higher.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by significant milestones?

src/verbosity.jl Outdated
(e.g., iteration counters, intermediate state), performance metrics
(e.g., timing information, memory usage), detailed diagnostics, and internal state information.
The only messages that should be `Silent()` at this preset are very small details that would
clutter output even during debugging.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clutter output even during debugging.
clutter output even during debugging and outputs that require a significant amount of additional computation
(for example, computing condition numbers of matrices which are normally not computed during the standard
usage).

src/verbosity.jl Outdated
This verbosity preset should set messages related to critical failures and
errors that stop computation to `ErrorLevel`. Messages related to potential issues
(e.g., convergence problems, parameter choices that may affect results, deprecated features)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(e.g., convergence problems, parameter choices that may affect results, deprecated features)
(e.g., convergence problems, solver exiting, etc.)

This verbosity preset should include the settings from `Minimal`, while also setting
messages such as important initialization messages (e.g., algorithm selection, key parameter values),
significant milestones, convergence status, final results to `InfoLevel()` or higher.
"""
Copy link
Member

@ChrisRackauckas ChrisRackauckas Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""
Deprecation warnings should be included at `WarnLevel()`. Critical but non-fatal warnings, such as
major performance warnings about fallbacks related to a given problem/solver choice, should be
included at this level.
"""

src/verbosity.jl Outdated
the user with details.
This verbosity preset should include the settings from `Minimal`, while also setting
messages such as important initialization messages (e.g., algorithm selection, key parameter values),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we shouldn't print algorithm selection by default or key parameter values... that would be really noisy. We don't do that standard so why would we change that?

@ChrisRackauckas
Copy link
Member

What are the message levels and why aren't they 1-1 with presets?

Why are they using names @info, @warn, etc., are they redirecting the output to different logging forms or are they for levels? That makes no sense.

@ChrisRackauckas
Copy link
Member

I will merge so it has my updates, but there are still a lot of nonsensical things in here.

@ChrisRackauckas ChrisRackauckas merged commit bec0247 into SciML:main Oct 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants