Writing /var/lib/dokuwiki/data/meta/tutorials/python_development_standards.meta failed
tutorials:python_development_standards
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:python_development_standards [2019/06/25 02:49] – [Logging] dgarcia | tutorials:python_development_standards [2022/09/20 00:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 49: | Line 49: | ||
Logging is a very important part of every software project, because it is the best way to deliver valuable information to our users. Logs are used to report errors, warnings, or just general information of how the program is executing. Good logs help us to discover why the program fails some times, they help us diagnose problems with our programs and help us plan strategies for improvement. It is crucial to maintain good and healthy logging practices so that you can increase the maintainability of your code. | Logging is a very important part of every software project, because it is the best way to deliver valuable information to our users. Logs are used to report errors, warnings, or just general information of how the program is executing. Good logs help us to discover why the program fails some times, they help us diagnose problems with our programs and help us plan strategies for improvement. It is crucial to maintain good and healthy logging practices so that you can increase the maintainability of your code. | ||
- | Python developers, knowing that logs are so important, have developed a module just for this: the [[https:// | + | Python developers, knowing that logs are so important, have developed a module just for this: the [[https:// |
=== Logging levels === | === Logging levels === | ||
Line 118: | Line 118: | ||
</ | </ | ||
- | If you do not want to use `pip`, there are also [[https:// | + | If you do not want to use '' |
<code bash> | <code bash> | ||
Line 127: | Line 127: | ||
<code python> | <code python> | ||
- | from colorlog | + | import |
# create the format object with colors. | # create the format object with colors. | ||
- | formatter = ColoredFormatter( | + | formatter = colorlog.ColoredFormatter( |
- | " | + | "%(asctime)s%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", |
datefmt=None, | datefmt=None, | ||
reset=True, | reset=True, |
tutorials/python_development_standards.1561430965.txt.gz · Last modified: 2022/09/20 00:08 (external edit)