Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced log level management for zvm #33

Open
hendriknielaender opened this issue Apr 28, 2024 · 0 comments
Open

Enhanced log level management for zvm #33

hendriknielaender opened this issue Apr 28, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hendriknielaender
Copy link
Owner

Currently, zvm does not have a dynamic log level management system, which can lead to either an overload of verbose log information or a scarcity of necessary debug data.

Proposed Feature

Implement a log level management system in zvm's build.zig configuration. This system will allow for the adjustment of log verbosity through the build process, making it easier to manage application logging without modifying the source code.

Implementation Details

  • Log Level Setting: Introduce a build option in build.zig to specify the default log level, which can be overridden by environment variables or command-line arguments at runtime.
  • Build Options:
    • Add log level options similar to ZLS, allowing levels such as DEBUG, INFO, WARNING, ERROR, and FATAL.
    • Example: exe_options.addOption(std.log.Level, "log_level", b.option(std.log.Level, "log_level", "The Log Level to be used.") orelse .info);
  • Runtime Adjustability: Developers can adjust the log level on the fly, affecting the logging output without restarting the application or changing the code.
  • Use Case Specific Log Levels: Different parts of the application might have different appropriate default log levels, which can be configured individually.

Benefits

  • Improved Debugging: Easier to isolate issues with the ability to increase log levels in areas of interest without being overwhelmed by logs from other parts of the system.
  • Performance: Lower default log levels in performance-sensitive parts of the application, reducing the logging overhead.
  • Flexibility: Easier to manage and adjust logging behavior based on the environment, such as development, testing, and production.
@hendriknielaender hendriknielaender added enhancement New feature or request good first issue Good for newcomers labels Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant