In article <fae7479b-ecec-4114-9750-6595fa8c7...@googlegroups.com>,
 JL <lightai...@gmail.com> wrote:

> One of my favorite tools in C/C++ language is the preprocessor macros.
> 
> One example is switching certain print messages for debugging use only
> 
> #ifdef DEBUG_ENABLE
> DEBUG_PRINT   print
> #else
> DEBUG_PRINT
> 
> Is it possible to implement something similar in python? Thank you.

Why would you want to?  One of the most horrible things about C/C++ is 
the preprocessor.  Python has much better mechanisms to implement just 
about anything you would do with the preprocessor.

For the example you gave, you would log things as info() or debug(), and 
then adjust the filter level in the logger.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to