简体   繁体   中英

Printing at different levels in Python

I am from a Java background. In Java you can print at different levels in most frameworks. For example in log4J, you have log levels which can be set to Debug, Info, warn etc.

Does python have anything similar out of the box? ie without having to import another lbrary.

Thanks.

Yep! Have a look at the logging module. Here 'sa tutorial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM