Merge pull request #704 from seemethere/fix_camel_case
Fix camel case module
This commit is contained in:
commit
c530d5f016
|
@ -85,12 +85,12 @@ By default, log_config parameter is set to use sanic.config.LOGGING dictionary f
|
||||||
|
|
||||||
And `filters`:
|
And `filters`:
|
||||||
|
|
||||||
- accessFilter (using sanic.defaultFilter.DefaultFilter)<br>
|
- accessFilter (using sanic.log.DefaultFilter)<br>
|
||||||
The filter that allows only levels in `DEBUG`, `INFO`, and `NONE(0)`
|
The filter that allows only levels in `DEBUG`, `INFO`, and `NONE(0)`
|
||||||
|
|
||||||
|
|
||||||
- errorFilter (using sanic.defaultFilter.DefaultFilter)<br>
|
- errorFilter (using sanic.log.DefaultFilter)<br>
|
||||||
The filter taht allows only levels in `WARNING`, `ERROR`, and `CRITICAL`
|
The filter that allows only levels in `WARNING`, `ERROR`, and `CRITICAL`
|
||||||
|
|
||||||
There are two `loggers` used in sanic, and **must be defined if you want to create your own logging configuration**:
|
There are two `loggers` used in sanic, and **must be defined if you want to create your own logging configuration**:
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
from sanic.defaultFilter import DefaultFilter
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import syslog
|
import syslog
|
||||||
import platform
|
import platform
|
||||||
import types
|
import types
|
||||||
|
|
||||||
|
from sanic.log import DefaultFilter
|
||||||
|
|
||||||
SANIC_PREFIX = 'SANIC_'
|
SANIC_PREFIX = 'SANIC_'
|
||||||
|
|
||||||
_address_dict = {
|
_address_dict = {
|
||||||
|
|
|
@ -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
|
|
14
sanic/log.py
14
sanic/log.py
|
@ -1,4 +1,18 @@
|
||||||
import logging
|
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')
|
log = logging.getLogger('sanic')
|
||||||
netlog = logging.getLogger('network')
|
netlog = logging.getLogger('network')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user