import logging

logging.basicConfig(
    format='%(asctime)s %(levelname)-8s %(message)s',
    level=logging.INFO,
    datefmt='%Y-%m-%d %H:%M:%S')

import logging

logging.root.handlers = []
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s',
                    datefmt='%Y-%m-%d %H:%M:%S',
                    level=logging.INFO,
                    filename='triggear.log')

console = logging.StreamHandler()
console.setLevel(logging.WARNING)
logging.getLogger("").addHandler(console)

Add logging to file on side of logging to stdout
Add logging to file on side of logging to stdout

  import logging
  
- logging.basicConfig(
+ logging.root.handlers = []
-     format='%(asctime)s %(levelname)-8s %(message)s',
+ logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s',
-     level=logging.INFO,
-     datefmt='%Y-%m-%d %H:%M:%S')
+                     datefmt='%Y-%m-%d %H:%M:%S',
+                     level=logging.INFO,
+                     filename='triggear.log')
  
+ console = logging.StreamHandler()
+ console.setLevel(logging.WARNING)
+ logging.getLogger("").addHandler(console)
+ 
Add logging to file on side of logging to stdout
## Code Before:
import logging

logging.basicConfig(
    format='%(asctime)s %(levelname)-8s %(message)s',
    level=logging.INFO,
    datefmt='%Y-%m-%d %H:%M:%S')

## Instruction:
Add logging to file on side of logging to stdout
## Code After:
import logging

logging.root.handlers = []
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s',
                    datefmt='%Y-%m-%d %H:%M:%S',
                    level=logging.INFO,
                    filename='triggear.log')

console = logging.StreamHandler()
console.setLevel(logging.WARNING)
logging.getLogger("").addHandler(console)
