We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83df488 commit 44e9175Copy full SHA for 44e9175
1 file changed
logging_tut/logging_main.py
@@ -0,0 +1,14 @@
1
+import logging
2
+
3
+def function_to_log():
4
+ logging.basicConfig(filename='logging.log', filemode='w', format='%(asctime)s %(message)s')
5
+ logger = logging.getLogger()
6
+ logger.setLevel(logging.DEBUG)
7
+ logger.info('INFO')
8
+ logger.error('ERROR')
9
+ logger.warning('WARNING')
10
+ logger.critical('CRITICAL')
11
+ logger.debug('DEBUG')
12
13
+if __name__ == '__main__':
14
+ function_to_log()
0 commit comments