Skip to content

Select logger config at runtime#971

Merged
mssalvatore merged 10 commits into
appimagefrom
select-logger-config-at-runtime
Feb 24, 2021
Merged

Select logger config at runtime#971
mssalvatore merged 10 commits into
appimagefrom
select-logger-config-at-runtime

Conversation

@mssalvatore

Copy link
Copy Markdown
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

@mssalvatore mssalvatore requested a review from VakarisZ February 17, 2021 16:21
@codecov

codecov Bot commented Feb 17, 2021

Copy link
Copy Markdown

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 thread monkey/monkey_island.py Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

ghost commented Feb 24, 2021

Copy link
Copy Markdown

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