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

Config loggers by labels #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Aug 13, 2024

  1. Apply the logger config by label

    In order to support labels from Juju, we would like to be able to
    configure loggers by their labels. So if a logger has a label of a
    model namespace (UUID) then searching from the root module to set the
    level of a module should be possible.
    
    As you can configure both module names and labels at the same time,
    this becomes tricky. We don't want users to be able to configure a
    logger via a label directly and the label should always take
    precedence over a user input.
    SimonRichardson committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    9493fe0 View commit details
    Browse the repository at this point in the history
  2. Remove the logger label concept

    Labels should not be applied to loggers. There is no way to reference
    them directly from a root module. Labels for this concept should be
    more like Attributes, something that can be dynamic for a given
    logger, although I suspect that they should just be sent via the
    Logf method.
    SimonRichardson committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    d8c41f1 View commit details
    Browse the repository at this point in the history
  3. Remove the custom functions and use existing methods

    It's much cleaner if we can reuse existing methods to provide the
    additional functionality. The labels provide addition matching
    capabilities to config loggers and will only config the loggers
    that have a label intersection.
    SimonRichardson committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    564b008 View commit details
    Browse the repository at this point in the history
  4. Use lables when resetting logger levels

    Take into consideration the labels when resetting the logger levels.
    We don't want to reset all the logger levels if we're using a singular
    global logger.
    SimonRichardson committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    48b0873 View commit details
    Browse the repository at this point in the history