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

Select logger config at runtime #971

Merged
merged 10 commits into from
Feb 24, 2021
Merged

Conversation

mssalvatore
Copy link
Collaborator

What does this PR do?

Allows the logger configuration to be specified at runtime.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the documentation framework updated to reflect the changes?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally?
  • If applicable, add screenshots or log transcripts of the feature working

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #971 (399aaf1) into appimage (52f80e8) will increase coverage by 0.15%.
The diff coverage is 48.27%.

Impacted file tree graph

@@             Coverage Diff              @@
##           appimage     #971      +/-   ##
============================================
+ Coverage     19.10%   19.26%   +0.15%     
============================================
  Files           337      337              
  Lines         11487    11502      +15     
============================================
+ Hits           2195     2216      +21     
+ Misses         9292     9286       -6     
Impacted Files Coverage Δ
monkey/monkey_island.py 0.00% <0.00%> (ø)
monkey/monkey_island/cc/main.py 0.00% <ø> (ø)
monkey/monkey_island/cc/consts.py 100.00% <100.00%> (ø)
monkey/monkey_island/cc/island_logger.py 90.90% <100.00%> (+90.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52f80e8...3cd0188. Read the comment docs.

Comment on lines 47 to 49
# TODO: Address https://github.com/guardicore/monkey/pull/963#discussion_r575022748
# before merging appimage PR
(is_setup_only, server_config, logger_config) = parse_cli_args()
Copy link
Contributor

Choose a reason for hiding this comment

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

Would make sense to do it now?

if os.path.exists(path):
with open(path, 'rt') as f:
with open(path, "rt") as f:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's your take on " and '? I usually use ' for arguments and keys and " for strings (in log, exceptions, etc.). You think we should use only one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

black picked double quotes in this scenario. There's no recommendation from PEP8 as to which to use in what cases.

@mssalvatore mssalvatore merged commit 711fd22 into appimage Feb 24, 2021
@mssalvatore mssalvatore deleted the select-logger-config-at-runtime branch February 24, 2021 15:38
@ghost
Copy link

ghost commented Feb 24, 2021

DeepCode failed to analyze this pull request

Something went wrong despite trying multiple times, sorry about that.
Please comment this pull request with "Retry DeepCode" to manually retry, or contact us so that a human can look into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants