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

Python logging switch #1279

Merged
merged 24 commits into from
Dec 5, 2023

Conversation

bug-or-feature
Copy link
Collaborator

This PR makes a start at refactoring log.setup() from pst_logger. The pattern is pretty much the same in each case. The old way would make a copy of the pst_logger, setting new attributes at the same time. In most cases, the new way is to pass temporary log attributes into the logging call, those attributes only being active for one call. There were a few other cases where the result of log.setup() was ignored, duplicated or not used.

This PR does not refactor all instances of log.setup(), just the easy ones. The few remaining ones are more complex, usually because the logger instance is passed around to other functions. Those will follow in another PR; they are separated in case the solution is disputed.

This PR also includes changes to remove pst_logger type hints, some docs updates, and some TODOs for the remaining logging switch changes

@bug-or-feature bug-or-feature marked this pull request as draft October 25, 2023 16:14
@bug-or-feature
Copy link
Collaborator Author

Setting to draft while I dig into #1278

# Conflicts:
#	sysexecution/algos/algo_original_best.py
#	sysexecution/algos/common_functions.py
#	sysexecution/stack_handler/spawn_children_from_instrument_orders.py
#	systems/provided/dynamic_small_system_optimise/optimisation.py
@bug-or-feature bug-or-feature marked this pull request as ready for review November 14, 2023 16:43
@bug-or-feature bug-or-feature marked this pull request as draft November 27, 2023 11:04
@bug-or-feature
Copy link
Collaborator Author

Setting to draft while conflicts are resolved

# Conflicts:
#	sysbrokers/IB/client/ib_client.py
#	sysbrokers/IB/client/ib_contracts_client.py
#	sysbrokers/IB/client/ib_price_client.py
#	sysbrokers/IB/config/ib_instrument_config.py
#	sysbrokers/IB/ib_futures_contract_price_data.py
#	sysbrokers/IB/ib_orders.py
#	sysbrokers/broker_capital_data.py
#	sysdata/arctic/arctic_futures_per_contract_prices.py
#	sysdata/futures/contracts.py
#	sysdata/futures/futures_per_contract_prices.py
#	sysexecution/algos/algo.py
#	sysexecution/algos/common_functions.py
#	sysexecution/stack_handler/balance_trades.py
#	sysexecution/stack_handler/create_broker_orders_from_contract_orders.py
#	sysexecution/stack_handler/spawn_children_from_instrument_orders.py
#	sysexecution/strategies/strategy_order_handling.py
@bug-or-feature bug-or-feature marked this pull request as ready for review December 1, 2023 09:42
@robcarver17 robcarver17 merged commit 626333f into robcarver17:develop Dec 5, 2023
2 checks passed
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