# Path: notifications_utils/logging.py
# LOG_FORMAT = '%(asctime)s %(app_name)s %(name)s %(levelname)s ' \
#              '%(request_id)s "%(message)s" [in %(pathname)s:%(lineno)d]'
# TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
#     FORMAT_STRING_FIELDS_PATTERN = re.compile(r'\((.+?)\)', re.IGNORECASE)
# def init_app(app, statsd_client=None):
# def ensure_log_path_exists(path):
# def get_handlers(app):
#         def is_200_static_log(log):
# def configure_handler(handler, app, formatter):
#     def __init__(self, app_name):
#     def filter(self, record):
#     def request_id(self):
#     def filter(self, record):
#     def service_id(self):
#     def filter(self, record):
#     def add_fields(self, record):
#     def format(self, record):
#     def process_log_record(self, log_record):
# class AppNameFilter(logging.Filter):
# class RequestIdFilter(logging.Filter):
# class ServiceIdFilter(logging.Filter):
# class CustomLogFormatter(logging.Formatter):
# class JSONFormatter(BaseJSONFormatter):


import json
import logging as builtin_logging
import logging.handlers as builtin_logging_handlers
from notifications_utils import logging



def test_get_handlers_sets_up_logging_appropriately_with_debug(tmpdir):
    class App:
        config = {
            'NOTIFY_LOG_PATH': str(tmpdir / 'foo'),
            'NOTIFY_APP_NAME': 'bar',
            'NOTIFY_LOG_LEVEL': 'ERROR'
        }
        debug = True

    app = App()


# Path: notifications_utils/logging.py
# LOG_FORMAT = '%(asctime)s %(app_name)s %(name)s %(levelname)s ' \
#              '%(request_id)s "%(message)s" [in %(pathname)s:%(lineno)d]'
# TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
#     FORMAT_STRING_FIELDS_PATTERN = re.compile(r'\((.+?)\)', re.IGNORECASE)
# def init_app(app, statsd_client=None):
# def ensure_log_path_exists(path):
# def get_handlers(app):
#         def is_200_static_log(log):
# def configure_handler(handler, app, formatter):
#     def __init__(self, app_name):
#     def filter(self, record):
#     def request_id(self):
#     def filter(self, record):
#     def service_id(self):
#     def filter(self, record):
#     def add_fields(self, record):
#     def format(self, record):
#     def process_log_record(self, log_record):
# class AppNameFilter(logging.Filter):
# class RequestIdFilter(logging.Filter):
# class ServiceIdFilter(logging.Filter):
# class CustomLogFormatter(logging.Formatter):
# class JSONFormatter(BaseJSONFormatter):


# Path: tests/test_logging.py
import json
import logging as builtin_logging
import logging.handlers as builtin_logging_handlers
from notifications_utils import logging




def test_get_handlers_sets_up_logging_appropriately_with_debug(tmpdir):
    class App:
        config = {
            'NOTIFY_LOG_PATH': str(tmpdir / 'foo'),
            'NOTIFY_APP_NAME': 'bar',
            'NOTIFY_LOG_LEVEL': 'ERROR'
        }
        debug = True

    app = App()


    handlers = logging.get_handlers(app)