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

Simplify log infrastructure #5312

Merged
merged 1 commit into from Feb 21, 2024
Merged

Simplify log infrastructure #5312

merged 1 commit into from Feb 21, 2024

Conversation

ferrarimarco
Copy link
Collaborator

Proposed changes

  • Move log variables in log.sh to shorten linter.sh
  • Source log.sh as soon as possible, so we can use log functions and variables as soon as possible.
  • Validate 'boolean' log variables: LOG_DEBUG, LOG_VERBOSE, LOG_NOTICE, LOG_WARN, LOG_ERROR.
  • Move foreground color markers from an associative array (that we cannot export), inside the log function. This fixes an issue that we discovered while working on Add option to ignore shell library files for bash-exec #5254 where color markers were not available to subprocesses.
  • Remove background color markers because we don't use them.

/cc @bewuethr

Readiness checklist

In order to have this pull request merged, complete the following tasks.

Pull request author tasks

  • I included all the needed documentation for this change.
  • I provided the necessary tests.
  • I squashed all the commits into a single commit.
  • I followed the Conventional Commit v1.0.0 spec.
  • I wrote the necessary upgrade instructions in the upgrade guide.
  • If this pull request is about and existing issue,
    I added the Fix #ISSUE_NUMBER label to the description of the pull request.

Super-linter maintainer tasks

  • Label as breaking if this change breaks compatibility with the previous released version.
  • Label as either: automation, bug, documentation, enhancement, infrastructure.

- Move log variables in log.sh to shorten linter.sh
- Source log.sh as soon as possible, so we can use log functions and
  variables as soon as possible.
- Validate 'boolean' log variables: LOG_DEBUG, LOG_VERBOSE, LOG_NOTICE,
  LOG_WARN, LOG_ERROR.
- Move foreground color markers from an associative array (that we
  cannot export), inside the log function. This fixes an issue that we
  discovered while working on #5254 where color markers were not
  available to subprocesses.
- Remove background color markers because we don't use them.
@ferrarimarco ferrarimarco added bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label labels Feb 21, 2024
@ferrarimarco ferrarimarco self-assigned this Feb 21, 2024
@ferrarimarco ferrarimarco changed the title fix: simplify log infrastructure Simplify log infrastructure Feb 21, 2024
Copy link
Collaborator

@Hanse00 Hanse00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

@ferrarimarco ferrarimarco added this pull request to the merge queue Feb 21, 2024
@ferrarimarco
Copy link
Collaborator Author

Thanks for reviewing!

Merged via the queue into main with commit 0f91a56 Feb 21, 2024
79 checks passed
@ferrarimarco ferrarimarco deleted the refactor-log branch February 21, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants