
from __future__ import division, unicode_literals

import logging


LOGGER = logging.getLogger('weasyprint')

# Default to logging to stderr.
if not LOGGER.handlers:
    LOGGER.addHandler(logging.StreamHandler())

if LOGGER.level == logging.NOTSET:
    LOGGER.setLevel(logging.INFO)


from __future__ import division, unicode_literals

import logging


LOGGER = logging.getLogger('weasyprint')

# Default to logging to stderr.
if not LOGGER.handlers:
    handler = logging.StreamHandler()
    formatter = logging.Formatter('%(levelname)s: %(message)s')
    handler.setFormatter(formatter)
    LOGGER.addHandler(handler)

if LOGGER.level == logging.NOTSET:
    LOGGER.setLevel(logging.INFO)

Add a better default formatter for logs
Add a better default formatter for logs

  
  from __future__ import division, unicode_literals
  
  import logging
  
  
  LOGGER = logging.getLogger('weasyprint')
  
  # Default to logging to stderr.
  if not LOGGER.handlers:
-     LOGGER.addHandler(logging.StreamHandler())
+     handler = logging.StreamHandler()
+     formatter = logging.Formatter('%(levelname)s: %(message)s')
+     handler.setFormatter(formatter)
+     LOGGER.addHandler(handler)
  
  if LOGGER.level == logging.NOTSET:
      LOGGER.setLevel(logging.INFO)
  
Add a better default formatter for logs
## Code Before:

from __future__ import division, unicode_literals

import logging


LOGGER = logging.getLogger('weasyprint')

# Default to logging to stderr.
if not LOGGER.handlers:
    LOGGER.addHandler(logging.StreamHandler())

if LOGGER.level == logging.NOTSET:
    LOGGER.setLevel(logging.INFO)

## Instruction:
Add a better default formatter for logs
## Code After:

from __future__ import division, unicode_literals

import logging


LOGGER = logging.getLogger('weasyprint')

# Default to logging to stderr.
if not LOGGER.handlers:
    handler = logging.StreamHandler()
    formatter = logging.Formatter('%(levelname)s: %(message)s')
    handler.setFormatter(formatter)
    LOGGER.addHandler(handler)

if LOGGER.level == logging.NOTSET:
    LOGGER.setLevel(logging.INFO)
