-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Expand simple logging options #4832
Conversation
Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level"
@Gobberwart, thanks for your PR! By analyzing the annotation information on this pull request, we identified @extink, @mhdasding and @RedViper9 to be potential reviewers |
@mjmadsen Is this the sort of thing you had in mind? Feedback VERY MUCH appreciated. IN particular, I'm not a fan of the code in init.py which handles testing to see if new config options exist and loading them, or setting defaults if they don't exist. Sure there must be a better way to do it? |
No point trying to use the logger before it's been initialised. Moved to init_config.
Because really, do we need that?
Other things we could do with this that I haven't done anything about because I don't know if anyone cares.
|
I'll take a look in the next few hours. Sure I'll love it! |
if self.config.logging: | ||
logging_format = '%(message)s' | ||
logging_format_options = '' | ||
if ('show_log_level' in self.config.logging and self.config.logging['show_log_level']) or 'show_log_level' not in self.config.logging: |
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.
Can we check if 'show_log_level' is not present, and if so, set it to true. Then a second if for the actual format change?
Same with those below.
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.
That's what it does. First check is for "is in config and set true", second check is OR "not in config". If either condition is matched, it will be enabled.
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.
I get that. I'm a bit curious on the evaluation order in python as the "and self.config.logging['show_log_level'] might happen before we check if it is in self.config.logging.
Suppose we could put 'show_log_level' in self.config.logging inside of more parenthesis to make sure it happens first. If you could try to run it (as is) without them being defined, to see if there is an error. I would do this quick, but I'm at work (and working really hard :P).
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.
It shouldn't happen... the first condition (with the end) will fail on the first check and not even bother to perform the second.
For the sake of clarity, I'll reverse it :)
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.
It's subtle.
('show_log_level' in self.config.logging and self.config.logging['show_log_level'])
Might evaluate self.config.logging['show_log_level'] first, which would throw an error if it doesn't exist.
How about this:
if ('show_log_level' not in self.config.logging) or self.config.logging['show_log_level']):
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.
@mjmadsen How's this (in the latest commit for all three items)...?
if 'show_log_level' not in self.config.logging or \
('show_log_level' in self.config.logging and self.config.logging['show_log_level']):
logging_format = '[%(levelname)s] ' + logging_format
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.
Hahaha, I'm a derp. If the ('show_log_level' in self.config.logging) fails, I really don't need to check it again, do I?
2 minutes.
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.
OK, done and tested. All lines now follow the format you suggested as follows:
if ('show_log_level' not in self.config.logging) or self.config.logging['show_log_level']:
logging_format = '[%(levelname)s] ' + logging_format
I knew something wasn't quite right in there.
First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed.
@mjmadsen The pull approve is working, you can use 👍 in comment at the beginning or click on the detail link to set it up. |
if ('show_log_level' in self.config.logging and self.config.logging['show_log_level']) or 'show_log_level' not in self.config.logging: | ||
|
||
if 'show_log_level' not in self.config.logging or \ | ||
('show_log_level' in self.config.logging and self.config.logging['show_log_level']): |
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.
Sorry, I know I'm being a nazi here. The checks in the parenthesis will evaluate first, as parenthesis have a higher evaluation precedence, even though python evaluates left to right. "in" has a lower precedence than attributes and indices.
Please use the following (reduces the double "in" check too):
if ('show_log_level' not in self.config.logging) or self.config.logging['show_log_level']:
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.
Done
Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen
All feedback incorporated. Should be ok to merge? |
@Gobberwart Thank you. Sorry I'm being nuts. It was the double It's showing me that it needs to be rebased. |
Heh @mjmadsen all good, I needed that second set of eyes. Better safe than sorry. |
@solderzzc Yeah, but sometimes CI can pass and we get no attrib (or indexerror) errors later. :) |
@Gobberwart rebase and I'll merge (appears to be out of date). |
@mjmadsen Test scripts existing in CI, better than nothing... much better. |
@mjmadsen done |
please try the pull approve :) |
Oh, neat. |
Finally see the 2 green status. |
* Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs
* Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (#4863)
* Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (#4863)
* Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * corrected logic to respect snipe = true * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (#4863) * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Add exceptions to json file read/writes (#4877) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Incubate eggs fix (#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs
* Update merge (#1) * Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * corrected logic to respect snipe = true * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (#4863) * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Add exceptions to json file read/writes (#4877) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Incubate eggs fix (#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * add some sanitycheck (#4891) * execute setup.sh -u if there is a need to (#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Call level_up_rewards on exp changes/Some pep-8 (#4896) * Call level_up_rewards on exp changes. * Cleanup * Improvements to evolve + config md updates (#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * 2000 pokestop in 24h limit (#4906) * 2000 pokestop in 24h limit * 2000 pokestop in 24h limit * add config variable * config update * Update readme.md + Improve FollowPath & SleepSchedule messages (#4911) * Use logger for follow path loiter message * Update readme.md * Improve sleep message * Allow follow_path to use config's distance unit * Allow follow_path to use config's distance unit * Reduce API calls (#4916) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Update player data in web from metrics Uses existing metrics instead of waiting on liveupdate * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Improvements to evolve + config md updates (#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * Incubate eggs fix (#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * Call level_up_rewards on exp changes/Some pep-8 (#4896) * Call level_up_rewards on exp changes. * Cleanup * add some sanitycheck (#4891) * execute setup.sh -u if there is a need to (#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Refactoring to share inventory and reduce api calls Modifications to share cached inventory and reduce overall required api calls from 4 to 1. Only remaining api call comes from heartbeat which updates the cached inventory for sanity reasons. * Remove import of UpdateWebPlayerdata Decided there was a better way to go with this, since both UpdateWebInventory and UpdateWebPlayerdata share the same inventory input/output, just different sections. Combined into UpdateWebInventory. * Fixed conflict * Import inventory added to metrics Allows metrics to use the cached inventory to retrieve player stats instead of making another api call * Removed api call from incubate_eggs Cached inventory should be accurate enough for this * Swap auth and config position (#4909) * add telegram check messages interval (#4919) * add telegram check messages interval * config changed * fix config * telegram doc update * Add documentation (#4921) See documentation for full list of new features * documented docker for the auth.json use case (#4922) add instructions for the docker run command for the multiple config files use case. * Fix for #4718 (#4924) * Add except variable * Add except variable * Fix filter (#4925) * improve docker pull speed (#4899) * Update inventory.py (#4928) FIX: #4926 * fixed a runtime error caused by incorrect imports (#4931) * Catch exception telegram.error.NetworkError. Fixs some pylint complain. * More config parameters for MoveToMap (#4937) * fixed a runtime error caused by incorrect imports * Moving module-level constants (snipe parameters) into config file * Add experimental pokemon upgrade (power-up) logic (#4938) Add upgrade cost data file Add last pokemon level. * Set default value of skip_rounds to 30 since many people just use the default value. 30 will behave close to human. * Add exception handling for cached forts (#4943) * Add exception handling for cached forts * whitespace fix * telegram to thread * config update * doc update * update web repo to have better web ui contribute. * Using $TIMEZONE environment variable to set timezone * fix errors * fix errors * Fixing clean run issues. * During startup, no bot object. * Added option PokemonGo-Bot-Configurator Smoothed some things up Added option to run PokemonGo-Bot-Configurator at the end of the installation. * Hotfix for EvolvePokemon (#4960) * Compatiable with old protocol define in map-chat. * Update merge (#2) * Expand simple logging options (#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (#4845) Fixed an faulty character * fix incubator logic (#4848) * corrected logic to respect snipe = true * Update configuration_files.md (#4854) * corrected logic to respect snipe = true (#4855) * Revert "corrected logic to respect snipe = true" (#4857) * dont forget to update the docs when adding config changes... (#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (#4863) * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Add exceptions to json file read/writes (#4877) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Incubate eggs fix (#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * add some sanitycheck (#4891) * execute setup.sh -u if there is a need to (#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Call level_up_rewards on exp changes/Some pep-8 (#4896) * Call level_up_rewards on exp changes. * Cleanup * Improvements to evolve + config md updates (#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * 2000 pokestop in 24h limit (#4906) * 2000 pokestop in 24h limit * 2000 pokestop in 24h limit * add config variable * config update * Update readme.md + Improve FollowPath & SleepSchedule messages (#4911) * Use logger for follow path loiter message * Update readme.md * Improve sleep message * Allow follow_path to use config's distance unit * Allow follow_path to use config's distance unit * Reduce API calls (#4916) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Update player data in web from metrics Uses existing metrics instead of waiting on liveupdate * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Improvements to evolve + config md updates (#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * Incubate eggs fix (#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * Call level_up_rewards on exp changes/Some pep-8 (#4896) * Call level_up_rewards on exp changes. * Cleanup * add some sanitycheck (#4891) * execute setup.sh -u if there is a need to (#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Refactoring to share inventory and reduce api calls Modifications to share cached inventory and reduce overall required api calls from 4 to 1. Only remaining api call comes from heartbeat which updates the cached inventory for sanity reasons. * Remove import of UpdateWebPlayerdata Decided there was a better way to go with this, since both UpdateWebInventory and UpdateWebPlayerdata share the same inventory input/output, just different sections. Combined into UpdateWebInventory. * Fixed conflict * Import inventory added to metrics Allows metrics to use the cached inventory to retrieve player stats instead of making another api call * Removed api call from incubate_eggs Cached inventory should be accurate enough for this * Swap auth and config position (#4909) * add telegram check messages interval (#4919) * add telegram check messages interval * config changed * fix config * telegram doc update * Add documentation (#4921) See documentation for full list of new features * documented docker for the auth.json use case (#4922) add instructions for the docker run command for the multiple config files use case. * Fix for #4718 (#4924) * Add except variable * Add except variable * Fix filter (#4925) * improve docker pull speed (#4899) * Update inventory.py (#4928) FIX: #4926 * fixed a runtime error caused by incorrect imports (#4931) * Catch exception telegram.error.NetworkError. Fixs some pylint complain. * More config parameters for MoveToMap (#4937) * fixed a runtime error caused by incorrect imports * Moving module-level constants (snipe parameters) into config file * Add experimental pokemon upgrade (power-up) logic (#4938) Add upgrade cost data file Add last pokemon level. * Set default value of skip_rounds to 30 since many people just use the default value. 30 will behave close to human. * Add exception handling for cached forts (#4943) * Add exception handling for cached forts * whitespace fix * telegram to thread * config update * doc update * update web repo to have better web ui contribute. * Using $TIMEZONE environment variable to set timezone * fix errors * fix errors * Fixing clean run issues. * During startup, no bot object. * Added option PokemonGo-Bot-Configurator Smoothed some things up Added option to run PokemonGo-Bot-Configurator at the end of the installation. * Hotfix for EvolvePokemon (#4960) * Compatiable with old protocol define in map-chat. * Provided a default for max_walking_distance and max_sniping_distance in order to avoid unhandled exceptions * Made sure nicknaming only waits if real api-relevant action was taken.
Fix nickname (PokemonGoF#5031) * Update merge (PokemonGoF#1) * Expand simple logging options (PokemonGoF#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (PokemonGoF#4845) Fixed an faulty character * fix incubator logic (PokemonGoF#4848) * corrected logic to respect snipe = true * Update configuration_files.md (PokemonGoF#4854) * corrected logic to respect snipe = true (PokemonGoF#4855) * Revert "corrected logic to respect snipe = true" (PokemonGoF#4857) * dont forget to update the docs when adding config changes... (PokemonGoF#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (PokemonGoF#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (PokemonGoF#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (PokemonGoF#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (PokemonGoF#4863) * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Add exceptions to json file read/writes (PokemonGoF#4877) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Incubate eggs fix (PokemonGoF#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * add some sanitycheck (PokemonGoF#4891) * execute setup.sh -u if there is a need to (PokemonGoF#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (PokemonGoF#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896) * Call level_up_rewards on exp changes. * Cleanup * Improvements to evolve + config md updates (PokemonGoF#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * 2000 pokestop in 24h limit (PokemonGoF#4906) * 2000 pokestop in 24h limit * 2000 pokestop in 24h limit * add config variable * config update * Update readme.md + Improve FollowPath & SleepSchedule messages (PokemonGoF#4911) * Use logger for follow path loiter message * Update readme.md * Improve sleep message * Allow follow_path to use config's distance unit * Allow follow_path to use config's distance unit * Reduce API calls (PokemonGoF#4916) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Update player data in web from metrics Uses existing metrics instead of waiting on liveupdate * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Improvements to evolve + config md updates (PokemonGoF#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * Incubate eggs fix (PokemonGoF#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896) * Call level_up_rewards on exp changes. * Cleanup * add some sanitycheck (PokemonGoF#4891) * execute setup.sh -u if there is a need to (PokemonGoF#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (PokemonGoF#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Refactoring to share inventory and reduce api calls Modifications to share cached inventory and reduce overall required api calls from 4 to 1. Only remaining api call comes from heartbeat which updates the cached inventory for sanity reasons. * Remove import of UpdateWebPlayerdata Decided there was a better way to go with this, since both UpdateWebInventory and UpdateWebPlayerdata share the same inventory input/output, just different sections. Combined into UpdateWebInventory. * Fixed conflict * Import inventory added to metrics Allows metrics to use the cached inventory to retrieve player stats instead of making another api call * Removed api call from incubate_eggs Cached inventory should be accurate enough for this * Swap auth and config position (PokemonGoF#4909) * add telegram check messages interval (PokemonGoF#4919) * add telegram check messages interval * config changed * fix config * telegram doc update * Add documentation (PokemonGoF#4921) See documentation for full list of new features * documented docker for the auth.json use case (PokemonGoF#4922) add instructions for the docker run command for the multiple config files use case. * Fix for PokemonGoF#4718 (PokemonGoF#4924) * Add except variable * Add except variable * Fix filter (PokemonGoF#4925) * improve docker pull speed (PokemonGoF#4899) * Update inventory.py (PokemonGoF#4928) FIX: PokemonGoF#4926 * fixed a runtime error caused by incorrect imports (PokemonGoF#4931) * Catch exception telegram.error.NetworkError. Fixs some pylint complain. * More config parameters for MoveToMap (PokemonGoF#4937) * fixed a runtime error caused by incorrect imports * Moving module-level constants (snipe parameters) into config file * Add experimental pokemon upgrade (power-up) logic (PokemonGoF#4938) Add upgrade cost data file Add last pokemon level. * Set default value of skip_rounds to 30 since many people just use the default value. 30 will behave close to human. * Add exception handling for cached forts (PokemonGoF#4943) * Add exception handling for cached forts * whitespace fix * telegram to thread * config update * doc update * update web repo to have better web ui contribute. * Using $TIMEZONE environment variable to set timezone * fix errors * fix errors * Fixing clean run issues. * During startup, no bot object. * Added option PokemonGo-Bot-Configurator Smoothed some things up Added option to run PokemonGo-Bot-Configurator at the end of the installation. * Hotfix for EvolvePokemon (PokemonGoF#4960) * Compatiable with old protocol define in map-chat. * Update merge (PokemonGoF#2) * Expand simple logging options (PokemonGoF#4832) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Changed ) to } (PokemonGoF#4845) Fixed an faulty character * fix incubator logic (PokemonGoF#4848) * corrected logic to respect snipe = true * Update configuration_files.md (PokemonGoF#4854) * corrected logic to respect snipe = true (PokemonGoF#4855) * Revert "corrected logic to respect snipe = true" (PokemonGoF#4857) * dont forget to update the docs when adding config changes... (PokemonGoF#4856) * dont forget to update the docs when adding config changes... * reflect config changes.... * please keep this as is (PokemonGoF#4859) Add stuff in the right order. * Clarify Max_distance for Sniping (PokemonGoF#4858) * Clarify Max_distance * Added distance unit and updated configuration_files.md * - debug improvements for MoveToMap (PokemonGoF#4860) - fix for Telegram to accept "@username" as "master", too, along with numeric IDs * Fixes catch rates. (PokemonGoF#4863) * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Add exceptions to json file read/writes (PokemonGoF#4877) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Incubate eggs fix (PokemonGoF#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * add some sanitycheck (PokemonGoF#4891) * execute setup.sh -u if there is a need to (PokemonGoF#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (PokemonGoF#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896) * Call level_up_rewards on exp changes. * Cleanup * Improvements to evolve + config md updates (PokemonGoF#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * 2000 pokestop in 24h limit (PokemonGoF#4906) * 2000 pokestop in 24h limit * 2000 pokestop in 24h limit * add config variable * config update * Update readme.md + Improve FollowPath & SleepSchedule messages (PokemonGoF#4911) * Use logger for follow path loiter message * Update readme.md * Improve sleep message * Allow follow_path to use config's distance unit * Allow follow_path to use config's distance unit * Reduce API calls (PokemonGoF#4916) * Fix bot crash at start on permaban * Expanded logging options Added "logging" section to config, with options "color", "show_datetime", "show_process_name" and "show_log_level" * Added warning about deprecated logging_color arg * Display log message moved No point trying to use the logger before it's been initialised. Moved to init_config. * Remove milliseconds from datetime Because really, do we need that? * Reversed condition order for clarity First check: "if not in config", OR Second check: "is in config AND set to true" If either condition matches, the logging detail will be displayed. * Documented new log options * Modified conditions again Removed unnecessary second check for config values and slightly modified parentheses as per suggestion from @mjmadsen * Add exception handling to json file read/write ops * Removed API call in update live stats Instead of making a new api call, utilise stats already contained in metrics. * Update player data in web from metrics Uses existing metrics instead of waiting on liveupdate * Implemented more granularity in the "alert_catch" parameter for Telegram alerts. * Improvements to evolve + config md updates (PokemonGoF#4900) * Better do not evolve handling * Edit config * Update config * Edit config * Edit config * Edit config * Update config.json.path.example * Update config.json.map.example * Update config.json.example * Update config.json.cluster.example * Updated configuration_files.md * Add extra tests * Update config * Update config * Update config * Update config * Update config.json.pokemon.example * Update config.json.cluster.example * Begin fixing configuration_files.md * Small fix * Small fix * Bit for of config updated * Bit more on config * A few more to config md * Bit more of of an update * Incubate eggs fix (PokemonGoF#4881) * Fixed incubator_eggs wrong print * Fixed pokemon hatched from eggs not added to cached inventory * Fix * Fixed not using breakable incubators * Fixed error adding pokemon to cached inventory * Moved remove egg and add Pokemon to _hatch_eggs * Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896) * Call level_up_rewards on exp changes. * Cleanup * add some sanitycheck (PokemonGoF#4891) * execute setup.sh -u if there is a need to (PokemonGoF#4870) * execute setup.sh -u if there is a need to * ask the user whether to run setup.sh -u or not * fix grammatical error * Add PokemonGo bot version to docker image (PokemonGoF#4886) * fix pep8 * Add PokemonGo bot version to docker image * Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API * Fix remove pyc, pyo files * Refactoring to share inventory and reduce api calls Modifications to share cached inventory and reduce overall required api calls from 4 to 1. Only remaining api call comes from heartbeat which updates the cached inventory for sanity reasons. * Remove import of UpdateWebPlayerdata Decided there was a better way to go with this, since both UpdateWebInventory and UpdateWebPlayerdata share the same inventory input/output, just different sections. Combined into UpdateWebInventory. * Fixed conflict * Import inventory added to metrics Allows metrics to use the cached inventory to retrieve player stats instead of making another api call * Removed api call from incubate_eggs Cached inventory should be accurate enough for this * Swap auth and config position (PokemonGoF#4909) * add telegram check messages interval (PokemonGoF#4919) * add telegram check messages interval * config changed * fix config * telegram doc update * Add documentation (PokemonGoF#4921) See documentation for full list of new features * documented docker for the auth.json use case (PokemonGoF#4922) add instructions for the docker run command for the multiple config files use case. * Fix for PokemonGoF#4718 (PokemonGoF#4924) * Add except variable * Add except variable * Fix filter (PokemonGoF#4925) * improve docker pull speed (PokemonGoF#4899) * Update inventory.py (PokemonGoF#4928) FIX: PokemonGoF#4926 * fixed a runtime error caused by incorrect imports (PokemonGoF#4931) * Catch exception telegram.error.NetworkError. Fixs some pylint complain. * More config parameters for MoveToMap (PokemonGoF#4937) * fixed a runtime error caused by incorrect imports * Moving module-level constants (snipe parameters) into config file * Add experimental pokemon upgrade (power-up) logic (PokemonGoF#4938) Add upgrade cost data file Add last pokemon level. * Set default value of skip_rounds to 30 since many people just use the default value. 30 will behave close to human. * Add exception handling for cached forts (PokemonGoF#4943) * Add exception handling for cached forts * whitespace fix * telegram to thread * config update * doc update * update web repo to have better web ui contribute. * Using $TIMEZONE environment variable to set timezone * fix errors * fix errors * Fixing clean run issues. * During startup, no bot object. * Added option PokemonGo-Bot-Configurator Smoothed some things up Added option to run PokemonGo-Bot-Configurator at the end of the installation. * Hotfix for EvolvePokemon (PokemonGoF#4960) * Compatiable with old protocol define in map-chat. * Provided a default for max_walking_distance and max_sniping_distance in order to avoid unhandled exceptions * Made sure nicknaming only waits if real api-relevant action was taken.
Short Description:
Enhancements to logging output options
Adds new "logging" category to config, with the following options:
Note that this only takes effect after initial output due to the order in which things are loaded. Too much work at this stage to move everything around just for a few lines.
Fixes/Resolves/Closes (please use correct syntax):