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

check_#ALL format spec for perf handler does not work #3176

Open
mszpindler opened this issue Apr 30, 2024 · 2 comments · Fixed by #3202
Open

check_#ALL format spec for perf handler does not work #3176

mszpindler opened this issue Apr 30, 2024 · 2 comments · Fixed by #3202
Assignees
Milestone

Comments

@mszpindler
Copy link
Contributor

Specifying %(check_#ALL)s| alone as format for handlers_perflog fails to work.

@mszpindler
Copy link
Contributor Author

'handlers_perflog': [
                {
                    'type': 'filelog',
                    'prefix': '%(check_system)s/%(check_partition)s',
                    'level': 'verbose',
                    'format': '%(check_#ALL)s',
                    'datefmt': '%FT%T%:z',
                    'append': True,
                },
            ]

In the config file reproduces the issue.

@ekouts
Copy link
Contributor

ekouts commented Apr 30, 2024

Some more comments:

  • If another record attribute is defined in the format, before or after %(check_#ALL)s, it works fine. For example: 'format': '%(check_result)s|%(check_#ALL)s',
  • The error is coming from this line:
    super().__init__(fmt, datefmt, style)

It is easily fixable if we disable the validation (checks if fmt and style are mismatched):

    def __init__(self, fmt=None, datefmt=None, perffmt=None,
                 ignore_keys=None, style='%'):
        super().__init__(fmt, datefmt, style, validate=False)

but maybe there is a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merge To Develop
Development

Successfully merging a pull request may close this issue.

3 participants