G'day QuantConnect users! Is there any way to suppress specific log messages or colour particular logs? I want particular logged messages to stand out in the logger.
Thanks!
QUANTCONNECT COMMUNITY
G'day QuantConnect users! Is there any way to suppress specific log messages or colour particular logs? I want particular logged messages to stand out in the logger.
Thanks!
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Mia Alissi
QuantConnect's logging system does not currently support the suppression of specific log messages or the coloring of particular logs. However, you can use the
Log
method to add statements to the log file while your algorithm continues executing. This can be useful for debugging your backtests and live trading algorithms.Here's an example of how to use the
Log
method in Python:If you want to log messages only when your algorithm is live, you can use the
LiveMode
property:You can also create a method to only log in live mode:
Please note that the log length is capped by organization tier. If your organization hits the daily limit, you may need to contact QuantConnect. Also, if you log the same content multiple times, only the first instance is added to the log file. To bypass this rate-limit, you can add a timestamp to your log messages.
For more information, you can refer to the QuantConnect Documentation.
Sources:
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Tom Frew
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!