-
Notifications
You must be signed in to change notification settings - Fork 18
feat: downgrade logging level when AppMap recording is enabled #183
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
Conversation
|
Can you add something (Loom, asciinema, copy-and-paste terminal session, whatever) that shows the output for each of the new cases, please? |
|
I would like to check this with testcases. I changed the testcases to assert the logger output. I found that WARNING output gets produced as expected but INFO output isn't. I thought the logger was configured to not show INFO output but after changing that in both testcases and in |
|
Not seeing INFO output is a bug in pytest. I reproduced it with the instructions from here. However, it works with |
I agree that it's important to verify it with testcases. But, I'd also like to see what the user experience is actually going to look like, as seen in a terminal. |
|
Tested through this repo https://github.com/symwell/try_appmap_python
APPMAP=true,
APPMAP=false,
APPMAP=invalid,
APPMAP_RECORD_INVALID=true, I think after the latest change stuff gets printed 5 times. |
7ff3b12 to
ed511f8
Compare
|
Added screenshots and changed one more testcase now that a warning isn't printed. |
|
It doesn't seem ideal to print the same message multiple times. Can we do something about that? |
|
It also prints the warning without Got it to print the warning only once. |
|
Interesting: if the call to
In either case why is |
|
Created separate issue to address configuring logging for |
a092023 to
7f37bbb
Compare
apotterri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the body of the comment on the comment so it describes the change you made.
Show a warning when the agent does something the user is not necessarily expecting, or when the user made a mistake. So, if APPMAP=true or APPMAP=false or one of the APPMAP_RECORD_ variables is set to true or false, log at "info". If any of those variables is set to a value other than true or false, log at "warning". This is new behavior. Make the comparison with true or false be case-insensitive. Before it was done with '== "true"' and '== "false"'. If there's an environment variable that starts with the prefix APPMAP_RECORD_ but doesn't match one of the supported recording types, log a message at "warning". This is also new behavior. When recording by default log at "info": it's presumably exactly the behavior the user was hoping for when they installed the agent, and they'll see all the AppMaps that got generated.
7f37bbb to
f763eb6
Compare
apotterri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for making this update.












Don't show noise in the console.
APPMAP=true, orAPPMAP=false, or one of theAPPMAP_RECORD_variables is set to true or false, log atinfo.trueorfalse, write a message atwarning. This is new behavior.trueorfalsebe case-insensitive. Before it was done with== "true"and== "false".APPMAP_RECORD_but doesn't match one of the supported recording types, log a message atwarning. This is also new behavior.info: it's presumably exactly the behavior they were hoping for when they installed the agent, and they'll see all the AppMaps that got generated.Fixes #182.
Tested with
poetry run pytest -s -v appmap/test/test_django.py.