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

Refactor logging #11332

Closed
wants to merge 2 commits into from
Closed

Refactor logging #11332

wants to merge 2 commits into from

Conversation

rplevka
Copy link
Member

@rplevka rplevka commented Apr 25, 2023

The idea is to unify and add a proper structure to the logs.

  • removal of logzero and relying purely on native logging library
  • external lib loggers (broker, manifester) initialization, so they use the same handlers.
  • introduction of logger hierarchy per module (adds structure to the logs)
  • change file-logging strategy: each fixture and test uses its own log file (makes logging to external resources possible)

@rplevka rplevka marked this pull request as draft April 25, 2023 07:35
@rplevka rplevka mentioned this pull request Apr 25, 2023
2 tasks
Copy link
Member

@JacobCallahan JacobCallahan left a comment

Choose a reason for hiding this comment

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

I'll reserve comments about the functionality of this PR until I see it demonstrated.

@@ -2,7 +2,7 @@
from pathlib import Path

import pytest
from broker import Broker
from broker.broker import Broker
Copy link
Member

Choose a reason for hiding this comment

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

Raised a question about this in the Broker PR, so I won't repeat it further in this PR, but this is likely a blocker for me.

@@ -24,6 +25,7 @@ def allow_repo_discovery(target_sat):
@pytest.fixture(autouse=True, scope="session")
def relax_bfa(session_target_sat):
"""Relax BFA protection against failed login attempts"""
logger.info('xxx inside relax_bfa fixture body')
Copy link
Member

Choose a reason for hiding this comment

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

natural language is typically easy enough to differentiate in logs without trigger characters

Suggested change
logger.info('xxx inside relax_bfa fixture body')
logger.info('inside relax_bfa fixture body')

Copy link
Member Author

@rplevka rplevka Apr 26, 2023

Choose a reason for hiding this comment

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

sorry, those are my working and debugging logs, so i can easily find and remove them when i'm finished :D

@@ -29,6 +29,7 @@ def test_positive_ping(target_sat):

:expectedresults: Overall and individual services status should be 'ok'.
"""
logger.info("xxx inside test body")
Copy link
Member

Choose a reason for hiding this comment

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

same comment as before

Suggested change
logger.info("xxx inside test body")
logger.info("inside test body")

@github-actions
Copy link

This pull request has not been updated in the past 45 days.

@github-actions github-actions bot added the Stale Stale issue or Pull Request label Jun 11, 2023
@github-actions
Copy link

This pull request is now being closed after stale warnings.

@github-actions github-actions bot closed this Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Stale issue or Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants