We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Consistent module naming
I don't want to be the bad guy 😄 , but there is a module file named with camelCase. Disregard me if this is not a problem.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sanic/log.py`
Content:
```
1 import logging
2 
3 log = logging.getLogger('sanic')
4 netlog = logging.getLogger('network')
5
```

Path: `sanic/defaultFilter.py`
Content:
```
1 import logging
2 
3 
4 class DefaultFilter(logging.Filter):
5     def __init__(self, param=None):
6         self.param = param
7 
8     def filter(self, record):
9         if self.param is None:
10             return True
11         if record.levelno in self.param:
12             return True
13         return False
14
```

Path: `sanic/config.py`
Content:
```
1 from sanic.defaultFilter import DefaultFilter
2 import os
3 import sys
4 import syslog
5 import platform
6 import types
7 
8 SANIC_PREFIX = 'SANIC_'
9 
10 _address_dict = {
11     'Windows': ('localhost', 514),
12     'Darwin': '/var/run/syslog',
13     'Linux': '/dev/log',
14     'FreeBSD': '/dev/log'
15 }
16 
17 LOGGING = {
18     'version': 1,
19     'filters': {
20         'accessFilter': {
21             '()': DefaultFilter,
22             'param': [0, 10, 20]
23         },
24         'errorFilter': {
25             '()': DefaultFilter,
26             'param': [30, 40, 50]
27         }
28     },
29     'formatters': {
30         'simple': {
31             'format': '%(asctime)s - (%(name)s)[%(levelname)s]: %(message)s',
32             'datefmt': '%Y-%m-%d %H:%M:%S'
33         },
34         'access': {
35             'format': '%(asctime)s - (%(name)s)[%(levelname)s][%(host)s]: ' +
36                       '%(request)s %(message)s %(status)d %(byte)d',
37             'datefmt': '%Y-%m-%d %H:%M:%S'
38         }
39     },
40     'handlers': {
41         'internal': {
42             'class': 'logging.StreamHandler',
43             'filters': ['accessFilter'],
44             'formatter': 'simple',
45             'stream': sys.stderr
46         },
47         'accessStream': {
48             'class': 'logging.StreamHandler',
49             'filters': ['accessFilter'],
50             'formatter': 'access',
51             'stream': sys.stderr
52         },
53         'errorStream': {
54             'class': 'logging.StreamHandler',
55             'filters': ['errorFilter'],
56             'formatter': 'simple',
57             'stream': sys.stderr
58         },
59         # before you use accessSysLog, be sure that log levels
60         # 0, 10, 20 have been enabled in you syslog configuration
61         # otherwise you won't be able to see the output in syslog
62         # logging file.
63         'accessSysLog': {
64             'class': 'logging.handlers.SysLogHandler',
65             'address': _address_dict.get(platform.system(),
66                                          ('localhost', 514)),
67             'facility': syslog.LOG_DAEMON,
68             'filters': ['accessFilter'],
69             'formatter': 'access'
70         },
71         'errorSysLog': {
72             'class': 'logging.handlers.SysLogHandler',
73             'address': _address_dict.get(platform.system(),
74                                          ('localhost', 514)),
75             'facility': syslog.LOG_DAEMON,
76             'filters': ['errorFilter'],
77             'formatter': 'simple'
78         },
79         'accessTimedRotatingFile': {
80             'class': 'logging.handlers.TimedRotatingFileHandler',
81             'filters': ['accessFilter'],
82             'formatter': 'access',
83             'when': 'D',
84             'interval': 1,
85             'backupCount': 7,
86             'filename': 'access.log'
87         },
88         'errorTimedRotatingFile': {
89             'class': 'logging.handlers.TimedRotatingFileHandler',
90             'filters': ['errorFilter'],
91             'when': 'D',
92             'interval': 1,
93             'backupCount': 7,
94             'filename': 'error.log',
95             'formatter': 'simple'
96         }
97     },
98     'loggers': {
99         'sanic': {
100             'level': 'DEBUG',
101             'handlers': ['internal', 'errorStream']
102         },
103         'network': {
104             'level': 'DEBUG',
105             'handlers': ['accessStream', 'errorStream']
106         }
107     }
108 }
109 
110 # this happens when using container or systems without syslog
111 # keep things in config would cause file not exists error
112 _addr = LOGGING['handlers']['accessSysLog']['address']
113 if type(_addr) is str and not os.path.exists(_addr):
114     LOGGING['handlers'].pop('accessSysLog')
115     LOGGING['handlers'].pop('errorSysLog')
116 
117 
118 class Config(dict):
119     def __init__(self, defaults=None, load_env=True, keep_alive=True):
120         super().__init__(defaults or {})
121         self.LOGO = """
122                  ▄▄▄▄▄
123         ▀▀▀██████▄▄▄       _______________
124       ▄▄▄▄▄  █████████▄  /                 \\
125      ▀▀▀▀█████▌ ▀▐▄ ▀▐█ |   Gotta go fast!  |
126    ▀▀█████▄▄ ▀██████▄██ | _________________/
127    ▀▄▄▄▄▄  ▀▀█▄▀█════█▀ |/
128         ▀▀▀▄  ▀▀███ ▀       ▄▄
129      ▄███▀▀██▄████████▄ ▄▀▀▀▀▀▀█▌
130    ██▀▄▄▄██▀▄███▀ ▀▀████      ▄██
131 ▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███     ▌▄▄▀
132 ▌    ▐▀████▐███▒▒▒▒▒▐██▌
133 ▀▄▄▄▄▀   ▀▀████▒▒▒▒▄██▀
134           ▀▀█████████▀
135         ▄▄██▀██████▀█
136       ▄██▀     ▀▀▀  █
137      ▄█             ▐▌
138  ▄▄▄▄█▌              ▀█▄▄▄▄▀▀▄
139 ▌     ▐                ▀▀▄▄▄▀
140  ▀▀▄▄▀
141 """
142         self.REQUEST_MAX_SIZE = 100000000  # 100 megababies
143         self.REQUEST_TIMEOUT = 60  # 60 seconds
144         self.KEEP_ALIVE = keep_alive
145 
146         if load_env:
147             self.load_environment_vars()
148 
149     def __getattr__(self, attr):
150         try:
151             return self[attr]
152         except KeyError as ke:
153             raise AttributeError("Config has no '{}'".format(ke.args[0]))
154 
155     def __setattr__(self, attr, value):
156         self[attr] = value
157 
158     def from_envvar(self, variable_name):
159         """Load a configuration from an environment variable pointing to
160         a configuration file.
161 
162         :param variable_name: name of the environment variable
163         :return: bool. ``True`` if able to load config, ``False`` otherwise.
164         """
165         config_file = os.environ.get(variable_name)
166         if not config_file:
167             raise RuntimeError('The environment variable %r is not set and '
168                                'thus configuration could not be loaded.' %
169                                variable_name)
170         return self.from_pyfile(config_file)
171 
172     def from_pyfile(self, filename):
173         """Update the values in the config from a Python file.
174         Only the uppercase variables in that module are stored in the config.
175 
176         :param filename: an absolute path to the config file
177         """
178         module = types.ModuleType('config')
179         module.__file__ = filename
180         try:
181             with open(filename) as config_file:
182                 exec(compile(config_file.read(), filename, 'exec'),
183                      module.__dict__)
184         except IOError as e:
185             e.strerror = 'Unable to load configuration file (%s)' % e.strerror
186             raise
187         self.from_object(module)
188         return True
189 
190     def from_object(self, obj):
191         """Update the values from the given object.
192         Objects are usually either modules or classes.
193 
194         Just the uppercase variables in that object are stored in the config.
195         Example usage::
196 
197             from yourapplication import default_config
198             app.config.from_object(default_config)
199 
200         You should not use this function to load the actual configuration but
201         rather configuration defaults. The actual config should be loaded
202         with :meth:`from_pyfile` and ideally from a location not within the
203         package because the package might be installed system wide.
204 
205         :param obj: an object holding the configuration
206         """
207         for key in dir(obj):
208             if key.isupper():
209                 self[key] = getattr(obj, key)
210 
211     def load_environment_vars(self):
212         """
213         Looks for any SANIC_ prefixed environment variables and applies
214         them to the configuration if present.
215         """
216         for k, v in os.environ.items():
217             if k.startswith(SANIC_PREFIX):
218                 _, config_key = k.split(SANIC_PREFIX, 1)
219                 self[config_key] = v
220
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sanic/config.py b/sanic/config.py
--- a/sanic/config.py
+++ b/sanic/config.py
@@ -1,10 +1,11 @@
-from sanic.defaultFilter import DefaultFilter
 import os
 import sys
 import syslog
 import platform
 import types
 
+from sanic.log import DefaultFilter
+
 SANIC_PREFIX = 'SANIC_'
 
 _address_dict = {
diff --git a/sanic/defaultFilter.py b/sanic/defaultFilter.py
deleted file mode 100644
--- a/sanic/defaultFilter.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import logging
-
-
-class DefaultFilter(logging.Filter):
-    def __init__(self, param=None):
-        self.param = param
-
-    def filter(self, record):
-        if self.param is None:
-            return True
-        if record.levelno in self.param:
-            return True
-        return False
diff --git a/sanic/log.py b/sanic/log.py
--- a/sanic/log.py
+++ b/sanic/log.py
@@ -1,4 +1,18 @@
 import logging
 
+
+class DefaultFilter(logging.Filter):
+
+    def __init__(self, param=None):
+        self.param = param
+
+    def filter(self, record):
+        if self.param is None:
+            return True
+        if record.levelno in self.param:
+            return True
+        return False
+
+
 log = logging.getLogger('sanic')
 netlog = logging.getLogger('network')

{"golden_diff": "diff --git a/sanic/config.py b/sanic/config.py\n--- a/sanic/config.py\n+++ b/sanic/config.py\n@@ -1,10 +1,11 @@\n-from sanic.defaultFilter import DefaultFilter\n import os\n import sys\n import syslog\n import platform\n import types\n \n+from sanic.log import DefaultFilter\n+\n SANIC_PREFIX = 'SANIC_'\n \n _address_dict = {\ndiff --git a/sanic/defaultFilter.py b/sanic/defaultFilter.py\ndeleted file mode 100644\n--- a/sanic/defaultFilter.py\n+++ /dev/null\n@@ -1,13 +0,0 @@\n-import logging\n-\n-\n-class DefaultFilter(logging.Filter):\n-    def __init__(self, param=None):\n-        self.param = param\n-\n-    def filter(self, record):\n-        if self.param is None:\n-            return True\n-        if record.levelno in self.param:\n-            return True\n-        return False\ndiff --git a/sanic/log.py b/sanic/log.py\n--- a/sanic/log.py\n+++ b/sanic/log.py\n@@ -1,4 +1,18 @@\n import logging\n \n+\n+class DefaultFilter(logging.Filter):\n+\n+    def __init__(self, param=None):\n+        self.param = param\n+\n+    def filter(self, record):\n+        if self.param is None:\n+            return True\n+        if record.levelno in self.param:\n+            return True\n+        return False\n+\n+\n log = logging.getLogger('sanic')\n netlog = logging.getLogger('network')\n", "issue": "Consistent module naming\nI don't want to be the bad guy \ud83d\ude04 , but there is a module file named with camelCase. Disregard me if this is not a problem.\n", "before_files": [{"content": "import logging\n\nlog = logging.getLogger('sanic')\nnetlog = logging.getLogger('network')\n", "path": "sanic/log.py"}, {"content": "import logging\n\n\nclass DefaultFilter(logging.Filter):\n    def __init__(self, param=None):\n        self.param = param\n\n    def filter(self, record):\n        if self.param is None:\n            return True\n        if record.levelno in self.param:\n            return True\n        return False\n", "path": "sanic/defaultFilter.py"}, {"content": "from sanic.defaultFilter import DefaultFilter\nimport os\nimport sys\nimport syslog\nimport platform\nimport types\n\nSANIC_PREFIX = 'SANIC_'\n\n_address_dict = {\n    'Windows': ('localhost', 514),\n    'Darwin': '/var/run/syslog',\n    'Linux': '/dev/log',\n    'FreeBSD': '/dev/log'\n}\n\nLOGGING = {\n    'version': 1,\n    'filters': {\n        'accessFilter': {\n            '()': DefaultFilter,\n            'param': [0, 10, 20]\n        },\n        'errorFilter': {\n            '()': DefaultFilter,\n            'param': [30, 40, 50]\n        }\n    },\n    'formatters': {\n        'simple': {\n            'format': '%(asctime)s - (%(name)s)[%(levelname)s]: %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        },\n        'access': {\n            'format': '%(asctime)s - (%(name)s)[%(levelname)s][%(host)s]: ' +\n                      '%(request)s %(message)s %(status)d %(byte)d',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        }\n    },\n    'handlers': {\n        'internal': {\n            'class': 'logging.StreamHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'simple',\n            'stream': sys.stderr\n        },\n        'accessStream': {\n            'class': 'logging.StreamHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'access',\n            'stream': sys.stderr\n        },\n        'errorStream': {\n            'class': 'logging.StreamHandler',\n            'filters': ['errorFilter'],\n            'formatter': 'simple',\n            'stream': sys.stderr\n        },\n        # before you use accessSysLog, be sure that log levels\n        # 0, 10, 20 have been enabled in you syslog configuration\n        # otherwise you won't be able to see the output in syslog\n        # logging file.\n        'accessSysLog': {\n            'class': 'logging.handlers.SysLogHandler',\n            'address': _address_dict.get(platform.system(),\n                                         ('localhost', 514)),\n            'facility': syslog.LOG_DAEMON,\n            'filters': ['accessFilter'],\n            'formatter': 'access'\n        },\n        'errorSysLog': {\n            'class': 'logging.handlers.SysLogHandler',\n            'address': _address_dict.get(platform.system(),\n                                         ('localhost', 514)),\n            'facility': syslog.LOG_DAEMON,\n            'filters': ['errorFilter'],\n            'formatter': 'simple'\n        },\n        'accessTimedRotatingFile': {\n            'class': 'logging.handlers.TimedRotatingFileHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'access',\n            'when': 'D',\n            'interval': 1,\n            'backupCount': 7,\n            'filename': 'access.log'\n        },\n        'errorTimedRotatingFile': {\n            'class': 'logging.handlers.TimedRotatingFileHandler',\n            'filters': ['errorFilter'],\n            'when': 'D',\n            'interval': 1,\n            'backupCount': 7,\n            'filename': 'error.log',\n            'formatter': 'simple'\n        }\n    },\n    'loggers': {\n        'sanic': {\n            'level': 'DEBUG',\n            'handlers': ['internal', 'errorStream']\n        },\n        'network': {\n            'level': 'DEBUG',\n            'handlers': ['accessStream', 'errorStream']\n        }\n    }\n}\n\n# this happens when using container or systems without syslog\n# keep things in config would cause file not exists error\n_addr = LOGGING['handlers']['accessSysLog']['address']\nif type(_addr) is str and not os.path.exists(_addr):\n    LOGGING['handlers'].pop('accessSysLog')\n    LOGGING['handlers'].pop('errorSysLog')\n\n\nclass Config(dict):\n    def __init__(self, defaults=None, load_env=True, keep_alive=True):\n        super().__init__(defaults or {})\n        self.LOGO = \"\"\"\n                 \u2584\u2584\u2584\u2584\u2584\n        \u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584       _______________\n      \u2584\u2584\u2584\u2584\u2584  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584  /                 \\\\\n     \u2580\u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u258c \u2580\u2590\u2584 \u2580\u2590\u2588 |   Gotta go fast!  |\n   \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588 | _________________/\n   \u2580\u2584\u2584\u2584\u2584\u2584  \u2580\u2580\u2588\u2584\u2580\u2588\u2550\u2550\u2550\u2550\u2588\u2580 |/\n        \u2580\u2580\u2580\u2584  \u2580\u2580\u2588\u2588\u2588 \u2580       \u2584\u2584\n     \u2584\u2588\u2588\u2588\u2580\u2580\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584 \u2584\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u258c\n   \u2588\u2588\u2580\u2584\u2584\u2584\u2588\u2588\u2580\u2584\u2588\u2588\u2588\u2580 \u2580\u2580\u2588\u2588\u2588\u2588      \u2584\u2588\u2588\n\u2584\u2580\u2580\u2580\u2584\u2588\u2588\u2584\u2580\u2580\u258c\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588     \u258c\u2584\u2584\u2580\n\u258c    \u2590\u2580\u2588\u2588\u2588\u2588\u2590\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2590\u2588\u2588\u258c\n\u2580\u2584\u2584\u2584\u2584\u2580   \u2580\u2580\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2584\u2588\u2588\u2580\n          \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n        \u2584\u2584\u2588\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\n      \u2584\u2588\u2588\u2580     \u2580\u2580\u2580  \u2588\n     \u2584\u2588             \u2590\u258c\n \u2584\u2584\u2584\u2584\u2588\u258c              \u2580\u2588\u2584\u2584\u2584\u2584\u2580\u2580\u2584\n\u258c     \u2590                \u2580\u2580\u2584\u2584\u2584\u2580\n \u2580\u2580\u2584\u2584\u2580\n\"\"\"\n        self.REQUEST_MAX_SIZE = 100000000  # 100 megababies\n        self.REQUEST_TIMEOUT = 60  # 60 seconds\n        self.KEEP_ALIVE = keep_alive\n\n        if load_env:\n            self.load_environment_vars()\n\n    def __getattr__(self, attr):\n        try:\n            return self[attr]\n        except KeyError as ke:\n            raise AttributeError(\"Config has no '{}'\".format(ke.args[0]))\n\n    def __setattr__(self, attr, value):\n        self[attr] = value\n\n    def from_envvar(self, variable_name):\n        \"\"\"Load a configuration from an environment variable pointing to\n        a configuration file.\n\n        :param variable_name: name of the environment variable\n        :return: bool. ``True`` if able to load config, ``False`` otherwise.\n        \"\"\"\n        config_file = os.environ.get(variable_name)\n        if not config_file:\n            raise RuntimeError('The environment variable %r is not set and '\n                               'thus configuration could not be loaded.' %\n                               variable_name)\n        return self.from_pyfile(config_file)\n\n    def from_pyfile(self, filename):\n        \"\"\"Update the values in the config from a Python file.\n        Only the uppercase variables in that module are stored in the config.\n\n        :param filename: an absolute path to the config file\n        \"\"\"\n        module = types.ModuleType('config')\n        module.__file__ = filename\n        try:\n            with open(filename) as config_file:\n                exec(compile(config_file.read(), filename, 'exec'),\n                     module.__dict__)\n        except IOError as e:\n            e.strerror = 'Unable to load configuration file (%s)' % e.strerror\n            raise\n        self.from_object(module)\n        return True\n\n    def from_object(self, obj):\n        \"\"\"Update the values from the given object.\n        Objects are usually either modules or classes.\n\n        Just the uppercase variables in that object are stored in the config.\n        Example usage::\n\n            from yourapplication import default_config\n            app.config.from_object(default_config)\n\n        You should not use this function to load the actual configuration but\n        rather configuration defaults. The actual config should be loaded\n        with :meth:`from_pyfile` and ideally from a location not within the\n        package because the package might be installed system wide.\n\n        :param obj: an object holding the configuration\n        \"\"\"\n        for key in dir(obj):\n            if key.isupper():\n                self[key] = getattr(obj, key)\n\n    def load_environment_vars(self):\n        \"\"\"\n        Looks for any SANIC_ prefixed environment variables and applies\n        them to the configuration if present.\n        \"\"\"\n        for k, v in os.environ.items():\n            if k.startswith(SANIC_PREFIX):\n                _, config_key = k.split(SANIC_PREFIX, 1)\n                self[config_key] = v\n", "path": "sanic/config.py"}], "after_files": [{"content": "import logging\n\n\nclass DefaultFilter(logging.Filter):\n\n    def __init__(self, param=None):\n        self.param = param\n\n    def filter(self, record):\n        if self.param is None:\n            return True\n        if record.levelno in self.param:\n            return True\n        return False\n\n\nlog = logging.getLogger('sanic')\nnetlog = logging.getLogger('network')\n", "path": "sanic/log.py"}, {"content": null, "path": "sanic/defaultFilter.py"}, {"content": "import os\nimport sys\nimport syslog\nimport platform\nimport types\n\nfrom sanic.log import DefaultFilter\n\nSANIC_PREFIX = 'SANIC_'\n\n_address_dict = {\n    'Windows': ('localhost', 514),\n    'Darwin': '/var/run/syslog',\n    'Linux': '/dev/log',\n    'FreeBSD': '/dev/log'\n}\n\nLOGGING = {\n    'version': 1,\n    'filters': {\n        'accessFilter': {\n            '()': DefaultFilter,\n            'param': [0, 10, 20]\n        },\n        'errorFilter': {\n            '()': DefaultFilter,\n            'param': [30, 40, 50]\n        }\n    },\n    'formatters': {\n        'simple': {\n            'format': '%(asctime)s - (%(name)s)[%(levelname)s]: %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        },\n        'access': {\n            'format': '%(asctime)s - (%(name)s)[%(levelname)s][%(host)s]: ' +\n                      '%(request)s %(message)s %(status)d %(byte)d',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        }\n    },\n    'handlers': {\n        'internal': {\n            'class': 'logging.StreamHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'simple',\n            'stream': sys.stderr\n        },\n        'accessStream': {\n            'class': 'logging.StreamHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'access',\n            'stream': sys.stderr\n        },\n        'errorStream': {\n            'class': 'logging.StreamHandler',\n            'filters': ['errorFilter'],\n            'formatter': 'simple',\n            'stream': sys.stderr\n        },\n        # before you use accessSysLog, be sure that log levels\n        # 0, 10, 20 have been enabled in you syslog configuration\n        # otherwise you won't be able to see the output in syslog\n        # logging file.\n        'accessSysLog': {\n            'class': 'logging.handlers.SysLogHandler',\n            'address': _address_dict.get(platform.system(),\n                                         ('localhost', 514)),\n            'facility': syslog.LOG_DAEMON,\n            'filters': ['accessFilter'],\n            'formatter': 'access'\n        },\n        'errorSysLog': {\n            'class': 'logging.handlers.SysLogHandler',\n            'address': _address_dict.get(platform.system(),\n                                         ('localhost', 514)),\n            'facility': syslog.LOG_DAEMON,\n            'filters': ['errorFilter'],\n            'formatter': 'simple'\n        },\n        'accessTimedRotatingFile': {\n            'class': 'logging.handlers.TimedRotatingFileHandler',\n            'filters': ['accessFilter'],\n            'formatter': 'access',\n            'when': 'D',\n            'interval': 1,\n            'backupCount': 7,\n            'filename': 'access.log'\n        },\n        'errorTimedRotatingFile': {\n            'class': 'logging.handlers.TimedRotatingFileHandler',\n            'filters': ['errorFilter'],\n            'when': 'D',\n            'interval': 1,\n            'backupCount': 7,\n            'filename': 'error.log',\n            'formatter': 'simple'\n        }\n    },\n    'loggers': {\n        'sanic': {\n            'level': 'DEBUG',\n            'handlers': ['internal', 'errorStream']\n        },\n        'network': {\n            'level': 'DEBUG',\n            'handlers': ['accessStream', 'errorStream']\n        }\n    }\n}\n\n# this happens when using container or systems without syslog\n# keep things in config would cause file not exists error\n_addr = LOGGING['handlers']['accessSysLog']['address']\nif type(_addr) is str and not os.path.exists(_addr):\n    LOGGING['handlers'].pop('accessSysLog')\n    LOGGING['handlers'].pop('errorSysLog')\n\n\nclass Config(dict):\n    def __init__(self, defaults=None, load_env=True, keep_alive=True):\n        super().__init__(defaults or {})\n        self.LOGO = \"\"\"\n                 \u2584\u2584\u2584\u2584\u2584\n        \u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584       _______________\n      \u2584\u2584\u2584\u2584\u2584  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584  /                 \\\\\n     \u2580\u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u258c \u2580\u2590\u2584 \u2580\u2590\u2588 |   Gotta go fast!  |\n   \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588 | _________________/\n   \u2580\u2584\u2584\u2584\u2584\u2584  \u2580\u2580\u2588\u2584\u2580\u2588\u2550\u2550\u2550\u2550\u2588\u2580 |/\n        \u2580\u2580\u2580\u2584  \u2580\u2580\u2588\u2588\u2588 \u2580       \u2584\u2584\n     \u2584\u2588\u2588\u2588\u2580\u2580\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584 \u2584\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u258c\n   \u2588\u2588\u2580\u2584\u2584\u2584\u2588\u2588\u2580\u2584\u2588\u2588\u2588\u2580 \u2580\u2580\u2588\u2588\u2588\u2588      \u2584\u2588\u2588\n\u2584\u2580\u2580\u2580\u2584\u2588\u2588\u2584\u2580\u2580\u258c\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588     \u258c\u2584\u2584\u2580\n\u258c    \u2590\u2580\u2588\u2588\u2588\u2588\u2590\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2590\u2588\u2588\u258c\n\u2580\u2584\u2584\u2584\u2584\u2580   \u2580\u2580\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2584\u2588\u2588\u2580\n          \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n        \u2584\u2584\u2588\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\n      \u2584\u2588\u2588\u2580     \u2580\u2580\u2580  \u2588\n     \u2584\u2588             \u2590\u258c\n \u2584\u2584\u2584\u2584\u2588\u258c              \u2580\u2588\u2584\u2584\u2584\u2584\u2580\u2580\u2584\n\u258c     \u2590                \u2580\u2580\u2584\u2584\u2584\u2580\n \u2580\u2580\u2584\u2584\u2580\n\"\"\"\n        self.REQUEST_MAX_SIZE = 100000000  # 100 megababies\n        self.REQUEST_TIMEOUT = 60  # 60 seconds\n        self.KEEP_ALIVE = keep_alive\n\n        if load_env:\n            self.load_environment_vars()\n\n    def __getattr__(self, attr):\n        try:\n            return self[attr]\n        except KeyError as ke:\n            raise AttributeError(\"Config has no '{}'\".format(ke.args[0]))\n\n    def __setattr__(self, attr, value):\n        self[attr] = value\n\n    def from_envvar(self, variable_name):\n        \"\"\"Load a configuration from an environment variable pointing to\n        a configuration file.\n\n        :param variable_name: name of the environment variable\n        :return: bool. ``True`` if able to load config, ``False`` otherwise.\n        \"\"\"\n        config_file = os.environ.get(variable_name)\n        if not config_file:\n            raise RuntimeError('The environment variable %r is not set and '\n                               'thus configuration could not be loaded.' %\n                               variable_name)\n        return self.from_pyfile(config_file)\n\n    def from_pyfile(self, filename):\n        \"\"\"Update the values in the config from a Python file.\n        Only the uppercase variables in that module are stored in the config.\n\n        :param filename: an absolute path to the config file\n        \"\"\"\n        module = types.ModuleType('config')\n        module.__file__ = filename\n        try:\n            with open(filename) as config_file:\n                exec(compile(config_file.read(), filename, 'exec'),\n                     module.__dict__)\n        except IOError as e:\n            e.strerror = 'Unable to load configuration file (%s)' % e.strerror\n            raise\n        self.from_object(module)\n        return True\n\n    def from_object(self, obj):\n        \"\"\"Update the values from the given object.\n        Objects are usually either modules or classes.\n\n        Just the uppercase variables in that object are stored in the config.\n        Example usage::\n\n            from yourapplication import default_config\n            app.config.from_object(default_config)\n\n        You should not use this function to load the actual configuration but\n        rather configuration defaults. The actual config should be loaded\n        with :meth:`from_pyfile` and ideally from a location not within the\n        package because the package might be installed system wide.\n\n        :param obj: an object holding the configuration\n        \"\"\"\n        for key in dir(obj):\n            if key.isupper():\n                self[key] = getattr(obj, key)\n\n    def load_environment_vars(self):\n        \"\"\"\n        Looks for any SANIC_ prefixed environment variables and applies\n        them to the configuration if present.\n        \"\"\"\n        for k, v in os.environ.items():\n            if k.startswith(SANIC_PREFIX):\n                _, config_key = k.split(SANIC_PREFIX, 1)\n                self[config_key] = v\n", "path": "sanic/config.py"}]}