Files
Home-AssistantConfig/deps/sqlalchemy/__pycache__/log.cpython-34.pyc

59 lines
6.8 KiB
Plaintext
Raw Normal View History

2016-10-11 16:42:06 +00:00
<EFBFBD>
|<7C><>W8<00>@s<>dZddlZddlZejd<00>ZejejkrRejej<00>ndd<00>Z e
<00>Z dd<00>Z Gdd <00>d e <00>ZGd
d <00>d e <00>Zdd d <00>ZGdd<00>de <00>ZdS)a<>Logging control and utilities.
Control of logging for SA can be performed from the regular python logging
module. The regular dotted module namespace is used, starting at
'sqlalchemy'. For class-level logging, the class name is appended.
The "echo" keyword parameter, available on SQLA :class:`.Engine`
and :class:`.Pool` objects, corresponds to a logger specific to that
instance only.
<EFBFBD>NZ
sqlalchemycCs9tjtj<00>}|jtjd<00><00>|j|<00>dS)Nz.%(asctime)s %(levelname)s %(name)s %(message)s)<07>logging<6E> StreamHandler<65>sys<79>stdout<75> setFormatter<65> Formatter<65>
addHandler)<02>logger<65>handler<65>r <00>4/tmp/pip-build-zkr322cu/sqlalchemy/sqlalchemy/log.py<70>_add_default_handler s 
r csatj|jd|j<17><00><00>fdd<00>|_<00>fdd<00>|_<00>|_tj|<00>|S)N<>.cs<00>jtj<00>S)N)<03> isEnabledForr<00>DEBUG)<01>self)r r r <00><lambda>,szclass_logger.<locals>.<lambda>cs<00>jtj<00>S)N)rr<00>INFO)r)r r r r-s) r<00> getLogger<65>
__module__<EFBFBD>__name__<5F>_should_log_debug<75>_should_log_infor <00>_logged_classes<65>add)<01>clsr )r r <00> class_logger*s   rc@s.eZdZdZdd<00>Zdd<00>ZdS)<06>
IdentifiedNcCs|jjtj<00>S)N)r rrr)rr r r r6szIdentified._should_log_debugcCs|jjtj<00>S)N)r rrr)rr r r r9szIdentified._should_log_info)rr<00> __qualname__<5F> logging_namerrr r r r r3s  rc@s<>eZdZdZiejd6ejd6ejd6ejd6Zdd<00>Z dd <00>Z
d
d <00>Z d d <00>Z e Z dd<00>Zdd<00>Zdd<00>Zdd<00>Zdd<00>Zdd<00>ZdS)<1A>InstanceLoggera!A logger adapter (wrapper) for :class:`.Identified` subclasses.
This allows multiple instances (e.g. Engine or Pool instances)
to share a logger, but have its verbosity controlled on a
per-instance basis.
The basic functionality is to return a logging level
which is based on an instance's echo setting.
Default implementation is:
'debug' -> logging.DEBUG
True -> logging.INFO
False -> Effective level of underlying logger
(logging.WARNING by default)
None -> same as False
NFT<46>debugcCsR||_tj|<00>|_|j|tjkrN|jj rNt|j<00>ndS)N)<08>echorrr <00> _echo_mapr<00>handlersr )rr"<00>namer r r <00>__init__Xs
  zInstanceLogger.__init__cOs|jtj|||<00>dS)z/Delegate a debug call to the underlying logger.N)<03>logrr)r<00>msg<73>args<67>kwargsr r r r!eszInstanceLogger.debugcOs|jtj|||<00>dS)z/Delegate an info call to the underlying logger.N)r'rr)rr(r)r*r r r <00>infojszInstanceLogger.infocOs|jtj|||<00>dS)z1Delegate a warning call to the underlying logger.N)r'r<00>WARNING)rr(r)r*r r r <00>warningoszInstanceLogger.warningcOs|jtj|||<00>dS)zB
Delegate an error call to the underlying logger.
N)r'r<00>ERROR)rr(r)r*r r r <00>errorvszInstanceLogger.errorcOs'd|d<|jtj|||<00>dS)z4Delegate an exception call to the underlying logger.<2E><00>exc_infoN)r'rr.)rr(r)r*r r r <00> exception|s
zInstanceLogger.exceptioncOs|jtj|||<00>dS)z2Delegate a critical call to the underlying logger.N)r'r<00>CRITICAL)rr(r)r*r r r <00>critical<61>szInstanceLogger.criticalcOsv|jjj|krdS|j|j}|tjkrJ|jj<00>}n||krr|jj||||<00>ndS)z<>Delegate a log call to the underlying logger.
The level here is determined by the echo
flag as well as that of the underlying logger, and
logger._log() is called directly.
N) r <00>manager<65>disabler#r"r<00>NOTSET<45>getEffectiveLevel<65>_log)r<00>levelr(r)r*Zselected_levelr r r r'<00>s  zInstanceLogger.logcCs)|jjj|krdS||j<00>kS)z)Is this logger enabled for level 'level'?F)r r5r6r8)rr:r r r r<00>szInstanceLogger.isEnabledForcCs5|j|j}|tjkr1|jj<00>}n|S)z+What's the effective level for this logger?)r#r"rr7r r8)rr:r r r r8<00>sz InstanceLogger.getEffectiveLevel)rrr<00>__doc__rr7rrr#r&r!r+r-<00>warnr/r2r4r'rr8r r r r r =s" 


         r cCs<>|jr.d|jj|jj|jf}nd|jj|jjf}||_|dkrqtj|<00>}nt||<00>}||_dS)zEcreate a logger for an instance that implements :class:`.Identified`.z%s.%s.%sz%s.%sFN)FN) r<00> __class__rr<00>_echorrr r )<04>instance<63>echoflagr%r r r r <00>instance_logger<65>s      rAc@s.eZdZdZdd<00>Zdd<00>ZdS)<07> echo_propertya} When ``True``, enable log output for this element.
This has the effect of setting the Python logging level for the namespace
of this element's class and object reference. A value of boolean ``True``
indicates that the loglevel ``logging.INFO`` will be set for the logger,
whereas the string value ``debug`` will set the loglevel to
``logging.DEBUG``.
cCs|dkr|S|jSdS)N)r>)rr?<00>ownerr r r <00>__get__<5F>s zecho_property.__get__cCst|d|<00>dS)Nr@)rA)rr?<00>valuer r r <00>__set__<5F>szecho_property.__set__N)rrrr;rDrFr r r r rB<00>s  rB)r;rrrZ
rootloggerr:r7<00>setLevel<65>WARNr <00>setrr<00>objectrr rArBr r r r <00><module>s     
p