Advertisement
DigitalMag

custom logging level

Jan 25th, 2021
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import logging
  2. DEBUG_LEVELV_NUM = 31
  3. logging.addLevelName(DEBUG_LEVELV_NUM, "[DEBUGV]")
  4. logging.basicConfig(level=logging.INFO)
  5.  
  6. logger = logging.getLogger(__name__)
  7. logger.setLevel(logging.INFO)
  8.  
  9.  
  10. def main():
  11.     logger.log(DEBUG_LEVELV_NUM, '---123---')
  12.     logger.info('123')
  13.  
  14. if __name__ == '__main__':
  15.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement