from config import config
import logging as root_logging

# Set up the logger

logger = root_logging.getLogger()
logger.setLevel(root_logging.INFO)

logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s')

logging_file_handler = root_logging.FileHandler(config['logging']['filename'])
logging_file_handler.setLevel(root_logging.INFO)
logging_file_handler.setFormatter(logger_format)
logger.addHandler(logging_file_handler)

logging_stream_handler = root_logging.StreamHandler()
logging_stream_handler.setLevel(root_logging.INFO)
logging_stream_handler.setFormatter(logger_format)
logger.addHandler(logging_stream_handler)

logging = root_logging
from config import config
import logging as root_logging

# Set up the logger

logger = root_logging.getLogger()
logger.setLevel(root_logging.INFO)

logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s', '%Y-%m-%d %H:%M:%S')

logging_file_handler = root_logging.FileHandler(config['logging_system']['filename'])
logging_file_handler.setLevel(root_logging.INFO)
logging_file_handler.setFormatter(logger_format)
logger.addHandler(logging_file_handler)

logging_stream_handler = root_logging.StreamHandler()
logging_stream_handler.setLevel(root_logging.INFO)
logging_stream_handler.setFormatter(logger_format)
logger.addHandler(logging_stream_handler)

logging = root_logging
Fix of the logging system exception
Fix of the logging system exception

Added a format to the date for the logging system. '%Y-%m-%d %H:%M:%S’.

Fixed an exception opening the logging file because the variable name
was not written correctly.

  from config import config
  import logging as root_logging
  
  # Set up the logger
  
  logger = root_logging.getLogger()
  logger.setLevel(root_logging.INFO)
  
- logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
+ logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s', '%Y-%m-%d %H:%M:%S')
  
- logging_file_handler = root_logging.FileHandler(config['logging']['filename'])
+ logging_file_handler = root_logging.FileHandler(config['logging_system']['filename'])
  logging_file_handler.setLevel(root_logging.INFO)
  logging_file_handler.setFormatter(logger_format)
  logger.addHandler(logging_file_handler)
  
  logging_stream_handler = root_logging.StreamHandler()
  logging_stream_handler.setLevel(root_logging.INFO)
  logging_stream_handler.setFormatter(logger_format)
  logger.addHandler(logging_stream_handler)
  
  logging = root_logging
Fix of the logging system exception
## Code Before:
from config import config
import logging as root_logging

# Set up the logger

logger = root_logging.getLogger()
logger.setLevel(root_logging.INFO)

logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s')

logging_file_handler = root_logging.FileHandler(config['logging']['filename'])
logging_file_handler.setLevel(root_logging.INFO)
logging_file_handler.setFormatter(logger_format)
logger.addHandler(logging_file_handler)

logging_stream_handler = root_logging.StreamHandler()
logging_stream_handler.setLevel(root_logging.INFO)
logging_stream_handler.setFormatter(logger_format)
logger.addHandler(logging_stream_handler)

logging = root_logging
## Instruction:
Fix of the logging system exception
## Code After:
from config import config
import logging as root_logging

# Set up the logger

logger = root_logging.getLogger()
logger.setLevel(root_logging.INFO)

logger_format = root_logging.Formatter('%(asctime)s %(levelname)s: %(message)s', '%Y-%m-%d %H:%M:%S')

logging_file_handler = root_logging.FileHandler(config['logging_system']['filename'])
logging_file_handler.setLevel(root_logging.INFO)
logging_file_handler.setFormatter(logger_format)
logger.addHandler(logging_file_handler)

logging_stream_handler = root_logging.StreamHandler()
logging_stream_handler.setLevel(root_logging.INFO)
logging_stream_handler.setFormatter(logger_format)
logger.addHandler(logging_stream_handler)

logging = root_logging