aws-cqc / aws-cqc/DeviceLayout.jl
More flexible SchematicLoggers
- Dominant language
- Julia
- Stars
- 67
- Forks
- 14
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 24
Description
Internal comment:
> Many tests in `test/test_schematicdriven.jl` test whether an error occured during the build stage; however, the error logs also flood the REPL. I tried wrapping these tests with `@suppress` from https://github.com/JuliaIO/Suppressor.jl but this suppresses way too aggressively... if the test fails, you don't get any output explaining why, which would make debugging failing tests a nightmare. Therefore probably the best approach is to not force `SchematicLogger` to include a console logger, as is currently done. Teeing to the console + a file should still be the default behavior, but it should be possible to disable logging to the REPL to accommodate these kinds of scenarios where you don't want all the pollution. Thoughts?
Seems like a good idea to be more flexible. You can probably manually replace the console logger in the tee with something like `sch.logger.logger.loggers[1] = Base.NullLogger()` but I think this faces the same problem in tests where nothing gets logged to console? So maybe you still need the console logger, but you want to filter out schematic-related log messages for it first. Should be doable by wrapping it with an [`EarlyFilteredLogger`](https://julialogging.github.io/reference/loggingextras/#LoggingExtras.EarlyFilteredLogger) that checks if `group` is any of `(:build, :plan, :render, :render_solidmodel)` (have to make sure we use `:render_solidmodel` consistently for messages there).
Contributor guide
Research direction
Start with test/test_schematicdriven.jl and inspect how SchematicLogger constructs its tee logger. Consider the suggested EarlyFilteredLogger approach and the build, plan, render, and render_solidmodel groups. Done means schematic-related logs can be excluded from the REPL while file logging and useful failure diagnostics remain available, with tee-to-console still the default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- developer-experience, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100