Conversation
Co-authored-by: ralsina <1579+ralsina@users.noreply.github.com>
Co-authored-by: ralsina <1579+ralsina@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] The logging level should be configurable via a command line option, like --log-level=DEBUG and an environment variable GRAFITO_LOG_LEVEL=DEBUG. The environment variable should be mentioned in the CLI usage message
Add configurable logging level via --log-level option and GRAFITO_LOG_LEVEL environment variable
Sep 19, 2025
ralsina
requested changes
Sep 19, 2025
|
|
||
| # Log at debug level. Probably worth making it configurable. | ||
| # Parse log level from command line or environment variable | ||
| log_level_str = args["--log-level"]?.as(String?) || ENV["GRAFITO_LOG_LEVEL"]? || "DEBUG" |
Owner
|
Nah, not working for me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements configurable logging levels as requested in the issue. Previously, Grafito was hardcoded to use DEBUG logging level, which could be too verbose for production use or insufficient for troubleshooting.
Changes
Added
--log-levelcommand line option that accepts the following log levels:TRACE- Most verbose, shows all log messagesDEBUG- Default level, includes debug informationINFO- General information messagesNOTICE- Notable eventsWARN- Warning messagesERROR- Error messages onlyFATAL- Only fatal errorsAdded
GRAFITO_LOG_LEVELenvironment variable support as documented in the CLI help. The environment variable is used as a fallback when no command line option is provided.Updated CLI usage message to document both the command line option and environment variable, making it clear to users how to control logging verbosity.
Usage Examples
Implementation Details
--log-level=infoand--log-level=INFOworkTechnical Notes
Fixed a Crystal compatibility issue where
Process::Status.system_exit_statuswas changed toexit_statusin newer Crystal versions. This was preventing the application from building with Crystal 1.11.2.All existing tests continue to pass, ensuring no regressions were introduced.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
d3fo0g5hm7lbuv.cloudfront.netcurl -fsSL REDACTED(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.