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

log: remove loghelper package #1721

Conversation

jmontesi
Copy link
Contributor

The functions in the loghelper package are not necessary anymore with the new log package as the check multilogger is able to log into the log file as well as into each check's log archive, which can be later used to fill the log section in the claim file.

Helper functions for the checks receive now the logger instance of the check, so that logs can be written inside those functions but tagged with the check's name and recorded in that check's log archive. For this, a new Logger type has been defined, as well as a set of methods to be used by the logger instance.

With the help of the new Logger type a small refactor of the log package is included in this change. Now the "log/slog" library is only used inside this package, isolating the rest of the code from any other logging libray than our internal log package.

The functions in the loghelper package are not necessary anymore with
the new log package as the check multilogger is able to log into the log
file as well as into each check's log archive, which can be later used to
fill the log section in the claim file.

Helper functions for the checks receive now the logger instance of the
check, so that logs can be written inside those functions but tagged with
the check's name and recorded in that check's log archive. For this, a
new Logger type has been defined, as well as a set of methods to be used
by the logger instance.

With the help of the new Logger type a small refactor of the log package
is included in this change. Now the "log/slog" library is only used
inside this package, isolating the rest of the code from any other
logging libray than our internal log package.
@jmontesi jmontesi merged commit c8ed3ad into redhat-best-practices-for-k8s:ginkgo_removal Dec 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants