add types to logging (#247)

This commit is contained in:
Valérian Rousset
2016-06-05 04:20:15 +02:00
committed by Guido van Rossum
parent e8e82a7c73
commit a581397c42
7 changed files with 606 additions and 880 deletions

View File

@@ -1,239 +0,0 @@
# Stubs for logging (Python 2.7)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Dict, Optional, Sequence, Tuple, overload, Union
CRITICAL = ... # type: int
FATAL = ... # type: int
ERROR = ... # type: int
WARNING = ... # type: int
WARN = ... # type: int
INFO = ... # type: int
DEBUG = ... # type: int
NOTSET = ... # type: int
def getLevelName(level: int) -> str: ...
def addLevelName(level: int, levelName: str) -> None: ...
class LogRecord:
name = ... # type: str
msg = ... # type: str
args = ... # type: Sequence[Any]
levelname = ... # type: str
levelno = ... # type: int
pathname = ... # type: str
filename = ... # type: str
module = ... # type: str
exc_info = ... # type: Tuple[Any, Any, Any]
exc_text = ... # type: str
lineno = ... # type: int
funcName = ... # type: Optional[str]
created = ... # type: float
msecs = ... # type: float
relativeCreated = ... # type: float
thread = ... # type: Any
threadName = ... # type: Any
processName = ... # type: Any
process = ... # type: Any
def __init__(self, name: str, level: int, pathname: str, lineno: int, msg: str,
args: Sequence[Any], exc_info: Tuple[Any, Any, Any], func: str = ...) -> None: ...
def getMessage(self) -> str: ...
def makeLogRecord(dict: Dict[str, Any]) -> LogRecord: ...
class PercentStyle:
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def __init__(self, fmt) -> None: ...
def usesTime(self) -> bool: ...
def format(self, record: LogRecord) -> str: ...
class StrFormatStyle(PercentStyle):
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def format(self, record: LogRecord) -> str: ...
class StringTemplateStyle(PercentStyle):
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def __init__(self, fmt) -> None: ...
def usesTime(self) -> bool: ...
def format(self, record: LogRecord) -> str: ...
BASIC_FORMAT = ... # type: Any
class Formatter:
converter = ... # type: Any
datefmt = ... # type: Any
def __init__(self, fmt: str = ..., datefmt: str = ...) -> None: ...
default_time_format = ... # type: Any
default_msec_format = ... # type: Any
def formatTime(self, record: LogRecord, datefmt: str =...) -> str: ...
def formatException(self, ei) -> str: ...
def usesTime(self) -> bool: ...
def formatMessage(self, record: LogRecord) -> str: ...
def formatStack(self, stack_info) -> str: ...
def format(self, record: LogRecord) -> str: ...
class BufferingFormatter:
linefmt = ... # type: Any
def __init__(self, linefmt: Formatter =...) -> None: ...
def formatHeader(self, records: list[LogRecord]) -> str: ...
def formatFooter(self, records: list[LogRecord]) -> str: ...
def format(self, records: list[LogRecord]) -> str: ...
class Filter:
name = ... # type: Any
nlen = ... # type: Any
def __init__(self, name: str = ...) -> None: ...
def filter(self, record: LogRecord) -> int: ...
class Filterer:
filters = ... # type: Any
def __init__(self) -> None: ...
def addFilter(self, filter: Filter) -> None: ...
def removeFilter(self, filter: Filter) -> None: ...
def filter(self, record: LogRecord) -> int: ...
class Handler(Filterer):
level = ... # type: Any
formatter = ... # type: Any
def __init__(self, level: int = ...) -> None: ...
def get_name(self): ...
def set_name(self, name) -> None: ...
name = ... # type: Any
lock = ... # type: Any
def createLock(self) -> None: ...
def acquire(self) -> None: ...
def release(self) -> None: ...
def setLevel(self, level: int) -> None: ...
def format(self, record: LogRecord) -> str: ...
def emit(self, record: LogRecord) -> None: ...
def handle(self, record: LogRecord) -> Any: ... # Return value undocumented
def setFormatter(self, fmt: Formatter) -> None: ...
def flush(self) -> None: ...
def close(self) -> None: ...
def handleError(self, record: LogRecord) -> None: ...
class StreamHandler(Handler):
terminator = ... # type: Any
stream = ... # type: Any
def __init__(self, stream=...) -> None: ...
def flush(self) -> None: ...
def emit(self, record: LogRecord) -> None: ...
class FileHandler(StreamHandler):
baseFilename = ... # type: Any
mode = ... # type: Any
encoding = ... # type: Any
delay = ... # type: Any
stream = ... # type: Any
def __init__(self, filename: str, mode: str = ..., encoding: str = ..., delay: int = ...) -> None: ...
def close(self) -> None: ...
def emit(self, record: LogRecord) -> None: ...
class _StderrHandler(StreamHandler):
def __init__(self, level: int =...) -> None: ...
lastResort = ... # type: Any
class PlaceHolder:
loggerMap = ... # type: Any
def __init__(self, alogger) -> None: ...
def append(self, alogger) -> None: ...
def setLoggerClass(klass) -> None: ...
def getLoggerClass(): ...
class Manager:
root = ... # type: Any
disable = ... # type: Any
emittedNoHandlerWarning = ... # type: Any
loggerDict = ... # type: Any
loggerClass = ... # type: Any
logRecordFactory = ... # type: Any
def __init__(self, rootnode) -> None: ...
def getLogger(self, name: unicode): ...
def setLoggerClass(self, klass) -> None: ...
def setLogRecordFactory(self, factory) -> None: ...
class Logger(Filterer):
name = ... # type: Any
level = ... # type: Any
parent = ... # type: Any
propagate = False
handlers = ... # type: Any
disabled = ... # type: Any
def __init__(self, name: str, level: int = ...) -> None: ...
def setLevel(self, level: int) -> None: ...
def debug(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def info(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def warning(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def warn(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def error(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def exception(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def critical(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
fatal = ... # type: Any
def log(self, level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def findCaller(self) -> Tuple[str, int, str]: ...
def makeRecord(self, name, level: int, fn, lno, msg, args,
exc_info, func=..., extra=..., sinfo=...) -> LogRecord: ...
def handle(self, record: LogRecord) -> None: ...
def addHandler(self, hdlr: Handler) -> None: ...
def removeHandler(self, hdlr: Handler) -> None: ...
def hasHandlers(self) -> None: ...
def callHandlers(self, record: LogRecord) -> None: ...
def getEffectiveLevel(self) -> int: ...
def isEnabledFor(self, level: int) -> bool: ...
def getChild(self, suffix: str) -> Logger: ...
class RootLogger(Logger):
def __init__(self, level: int) -> None: ...
class LoggerAdapter:
logger = ... # type: Any
extra = ... # type: Any
def __init__(self, logger, extra) -> None: ...
def process(self, msg, kwargs) -> Tuple[Any,Any]: ... # Possible mistake: kwargs missing **
def debug(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def info(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def warning(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def warn(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def error(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def exception(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def critical(self, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def log(self, level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def isEnabledFor(self, level: int) -> bool: ...
def setLevel(self, level: int) -> None: ...
def getEffectiveLevel(self) -> int: ...
def hasHandlers(self) -> bool: ...
def basicConfig(**kwargs) -> None: ...
def getLogger(name: str = ...) -> Logger: ...
def critical(msg: str, *args, **kwargs) -> None: ...
fatal = ... # type: Any
def error(msg: Union[str, unicode], *args, **kwargs) -> None: ...
@overload
def exception(msg: Union[str, unicode], *args, **kwargs) -> None: ...
@overload
def exception(exception: Exception, *args, **kwargs) -> None: ...
def warning(msg: Union[str, unicode], *args, **kwargs) -> None: ...
def warn(msg: Union[str, unicode], *args, **kwargs) -> None: ...
def info(msg: Union[str, unicode], *args, **kwargs) -> None: ...
def debug(msg: Union[str, unicode], *args, **kwargs) -> None: ...
def log(level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ...
def disable(level: int) -> None: ...
class NullHandler(Handler):
def handle(self, record: LogRecord) -> None: ...
def emit(self, record: LogRecord) -> None: ...
lock = ... # type: Any
def createLock(self): ...
def captureWarnings(capture: bool) -> None: ...

View File

@@ -1,202 +0,0 @@
# Stubs for logging.handlers (Python 2.7)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Tuple
from . import LogRecord
import logging
import socket
threading = ... # type: Any
DEFAULT_TCP_LOGGING_PORT = ... # type: Any
DEFAULT_UDP_LOGGING_PORT = ... # type: Any
DEFAULT_HTTP_LOGGING_PORT = ... # type: Any
DEFAULT_SOAP_LOGGING_PORT = ... # type: Any
SYSLOG_UDP_PORT = ... # type: Any
SYSLOG_TCP_PORT = ... # type: Any
class BaseRotatingHandler(logging.FileHandler):
mode = ... # type: Any
encoding = ... # type: Any
namer = ... # type: Any
rotator = ... # type: Any
def __init__(self, filename: unicode, mode: unicode, encoding: unicode =..., delay: int =...) -> None: ...
def emit(self, record: LogRecord) -> None: ...
def rotation_filename(self, default_name: unicode): ...
def rotate(self, source, dest): ...
class RotatingFileHandler(BaseRotatingHandler):
maxBytes = ... # type: Any
backupCount = ... # type: Any
def __init__(self, filename: unicode, mode: unicode = ..., maxBytes: int = ..., backupCount:int = ...,
encoding: str = ..., delay: int = ...) -> None: ...
stream = ... # type: Any
def doRollover(self) -> None: ...
def shouldRollover(self, record: LogRecord) -> int: ...
class TimedRotatingFileHandler(BaseRotatingHandler):
when = ... # type: Any
backupCount = ... # type: Any
utc = ... # type: Any
atTime = ... # type: Any
interval = ... # type: Any
suffix = ... # type: Any
extMatch = ... # type: Any
dayOfWeek = ... # type: Any
rolloverAt = ... # type: Any
def __init__(self, filename: unicode, when: unicode =..., interval: int =..., backupCount: int =...,
encoding: unicode =..., delay: bool =..., utc: bool =..., atTime=...) -> None: ...
def computeRollover(self, currentTime: int) -> int: ...
def shouldRollover(self, record: LogRecord) -> int: ...
def getFilesToDelete(self) -> list[str]: ...
stream = ... # type: Any
def doRollover(self) -> None: ...
class WatchedFileHandler(logging.FileHandler):
def __init__(self, filename: str, mode: str = ..., encoding: str = ..., delay: int = ...) -> None: ...
stream = ... # type: Any
def emit(self, record: LogRecord) -> None: ...
class SocketHandler(logging.Handler):
host = ... # type: Any
port = ... # type: Any
address = ... # type: Any
sock = ... # type: Any
closeOnError = ... # type: Any
retryTime = ... # type: Any
retryStart = ... # type: Any
retryMax = ... # type: Any
retryFactor = ... # type: Any
def __init__(self, host, port) -> None: ...
def makeSocket(self, timeout: int =...): ...
retryPeriod = ... # type: Any
def createSocket(self) -> None: ...
def send(self, s: str) -> None: ...
def makePickle(self, record: LogRecord) -> str: ...
def handleError(self, record: LogRecord) -> None: ...
def emit(self, record: LogRecord) -> None: ...
def close(self) -> None: ...
class DatagramHandler(SocketHandler):
closeOnError = ... # type: Any
def __init__(self, host, port) -> None: ...
def makeSocket(self, timeout: int =...) -> None: ...
def send(self, s: str) -> None: ...
class SysLogHandler(logging.Handler):
LOG_EMERG = ... # type: Any
LOG_ALERT = ... # type: Any
LOG_CRIT = ... # type: Any
LOG_ERR = ... # type: Any
LOG_WARNING = ... # type: Any
LOG_NOTICE = ... # type: Any
LOG_INFO = ... # type: Any
LOG_DEBUG = ... # type: Any
LOG_KERN = ... # type: Any
LOG_USER = ... # type: Any
LOG_MAIL = ... # type: Any
LOG_DAEMON = ... # type: Any
LOG_AUTH = ... # type: Any
LOG_SYSLOG = ... # type: Any
LOG_LPR = ... # type: Any
LOG_NEWS = ... # type: Any
LOG_UUCP = ... # type: Any
LOG_CRON = ... # type: Any
LOG_AUTHPRIV = ... # type: Any
LOG_FTP = ... # type: Any
LOG_LOCAL0 = ... # type: Any
LOG_LOCAL1 = ... # type: Any
LOG_LOCAL2 = ... # type: Any
LOG_LOCAL3 = ... # type: Any
LOG_LOCAL4 = ... # type: Any
LOG_LOCAL5 = ... # type: Any
LOG_LOCAL6 = ... # type: Any
LOG_LOCAL7 = ... # type: Any
priority_names = ... # type: Any
facility_names = ... # type: Any
priority_map = ... # type: Any
address = ... # type: Any
facility = ... # type: Any
socktype = ... # type: Any
unixsocket = ... # type: Any
socket = ... # type: Any
formatter = ... # type: Any
def __init__(self, address: tuple[str,int] =..., facility: int =..., socktype: int =...) -> None: ...
def encodePriority(self, facility: int, priority: Union[basestring,int]) -> int: ...
def close(self) -> None: ...
def mapPriority(self, levelName: str) -> str: ...
ident = ... # type: Any
append_nul = ... # type: Any
def emit(self, record: LogRecord) -> None: ...
class SMTPHandler(logging.Handler):
username = ... # type: Any
fromaddr = ... # type: Any
toaddrs = ... # type: Any
subject = ... # type: Any
secure = ... # type: Any
timeout = ... # type: Any
def __init__(self, mailhost, fromaddr, toaddrs, subject: unicode, credentials: Tuple[Any,Any]=...,
secure=...) -> None: ...
def getSubject(self, record: LogRecord) -> unicode: ...
def emit(self, record: LogRecord) -> None: ...
class NTEventLogHandler(logging.Handler):
appname = ... # type: Any
dllname = ... # type: Any
logtype = ... # type: Any
deftype = ... # type: Any
typemap = ... # type: Any
def __init__(self, appname, dllname=..., logtype: str =...) -> None: ...
def getMessageID(self, record: LogRecord) -> int: ...
def getEventCategory(self, record: LogRecord) -> int: ...
def getEventType(self, record: LogRecord): ...
def emit(self, record: LogRecord) -> None: ...
def close(self) -> None: ...
class HTTPHandler(logging.Handler):
host = ... # type: Any
url = ... # type: Any
method = ... # type: Any
secure = ... # type: Any
credentials = ... # type: Any
def __init__(self, host, url, method: str =..., secure=..., credentials=...) -> None: ...
def mapLogRecord(self, record: LogRecord) -> dict[Any,Any]: ...
def emit(self, record: LogRecord) -> None: ...
class BufferingHandler(logging.Handler):
capacity = ... # type: Any
buffer = ... # type: Any
def __init__(self, capacity: int) -> None: ...
def shouldFlush(self, record: LogRecord) -> bool: ...
def emit(self, record: LogRecord) -> None: ...
def flush(self) -> None: ...
def close(self) -> None: ...
class MemoryHandler(BufferingHandler):
flushLevel = ... # type: Any
target = ... # type: Any
def __init__(self, capacity: int, flushLevel: int =..., target=...) -> None: ...
def shouldFlush(self, record: LogRecord) -> bool: ...
def setTarget(self, target) -> None: ...
buffer = ... # type: Any
def flush(self) -> None: ...
def close(self) -> None: ...
class QueueHandler(logging.Handler):
queue = ... # type: Any
def __init__(self, queue) -> None: ...
def enqueue(self, record: LogRecord): ...
def prepare(self, record: LogRecord): ...
def emit(self, record: LogRecord) -> None: ...
class QueueListener:
queue = ... # type: Any
handlers = ... # type: Any
def __init__(self, queue, *handlers) -> None: ...
def dequeue(self, block): ...
def start(self) -> None: ...
def prepare(self, record: LogRecord): ...
def handle(self, record: LogRecord): ...
def enqueue_sentinel(self): ...
def stop(self) -> None: ...

View File

@@ -0,0 +1,354 @@
## Stubs for logging (Python 3.4)
from typing import (
Any, Callable, Iterable, Mapping, MutableMapping, Optional, TextIO, Tuple,
Union,
overload,
)
from types import TracebackType
import sys
_SysExcInfoType = Union[Tuple[type, BaseException, TracebackType],
Tuple[None, None, None]]
if sys.version_info >= (3, 5):
_ExcInfoType = Union[bool, _SysExcInfoType, Exception]
else:
_ExcInfoType = Union[bool, _SysExcInfoType]
_ArgsType = Union[Tuple[Any, ...], Dict[str, Any]]
_FilterType = Union['Filter', Callable[[LogRecord], int]]
class Logger:
propagate = ... # type: bool
def setLevel(self, lvl: Union[int, str]) -> None: ...
def isEnabledFor(self, lvl: int) -> None: ...
def getEffectiveLevel(self) -> int: ...
def getChild(self, suffix: str) -> 'Logger': ...
if sys.version_info > (3,):
def debug(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def info(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def warning(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def warn(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def error(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def critical(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def log(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def exception(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
else:
def debug(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def info(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def warning(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def warn(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def error(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def critical(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def log(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def exception(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def addFilter(self, filt: _FilterType) -> None: ...
def removeFilter(self, filt: _FilterType) -> None: ...
def filter(self, record: 'LogRecord') -> bool: ...
def addHandler(self, hdlr: 'Handler') -> None: ...
def removeHandler(self, hdlr: 'Handler') -> None: ...
if sys.version_info >= (3,):
def findCaller(self, stack_info: bool = ...) \
-> Tuple[str, int, str, Optional[str]]: ...
else:
def findCaller(self # type: ignore
) -> Tuple[str, int, str]: ...
def handle(self, record: 'LogRecord') -> None: ...
if sys.version_info >= (3,):
def makeRecord(self, name: str, lvl: int, fn: str, lno: int, msg: str,
args: Mapping[str, Any],
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...,
extra: Optional[Mapping[str, Any]] = ...,
sinfo: Optional[str] = ...) -> None: ...
else:
def makeRecord(self, # type: ignore
name: str, lvl: int, fn: str, lno: int, msg: str,
args: Mapping[str, Any],
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...,
extra: Optional[Mapping[str, Any]] = ...) -> None: ...
if sys.version_info >= (3,):
def hasHandlers(self) -> bool: ...
CRITICAL = ... # type: int
ERROR = ... # type: int
WARNING = ... # type: Any
INFO = ... # type: int
DEBUG = ... # type: int
NOTSET = ... # type: int
class Handler:
def __init__(self, level: int = ...) -> None: ...
def createLock(self) -> None: ...
def acquire(self) -> None: ...
def release(self) -> None: ...
def setLevel(self, lvl: Union[int, str]) -> None: ...
def setFormatter(self, form: 'Formatter') -> None: ...
def addFilter(self, filt: _FilterType) -> None: ...
def removeFilter(self, filt: _FilterType) -> None: ...
def filter(self, record: 'LogRecord') -> bool: ...
def flush(self) -> None: ...
def close(self) -> None: ...
def handle(self, record: 'LogRecord') -> None: ...
def handleError(self, record: 'LogRecord') -> None: ...
def format(self, record: 'LogRecord') -> None: ...
def emit(self, record: 'LogRecord') -> None: ...
class Formatter:
if sys.version_info >= (3,):
def __init__(self, fmt: Optional[str] = ...,
datefmt: Optional[str] =...,
style: str = ...) -> None: ...
else:
def __init__(self, # type: ignore
fmt: Optional[str] = ...,
datefmt: Optional[str] =...) -> None: ...
def format(self, record: LogRecord) -> str: ...
def formatTime(self, record: LogRecord, datefmt: str = ...) -> str: ...
def formatException(self, exc_info: _SysExcInfoType) -> str: ...
if sys.version_info >= (3,):
def formatStack(self, stack_info: str) -> str: ...
class Filter:
def __init__(self, name: str = ...) -> None: ...
def filter(self, record: LogRecord) -> int: ...
class LogRecord:
args = ... # type: _ArgsType
asctime = ... # type: str
created = ... # type: int
exc_info = ... # type: Optional[_SysExcInfoType]
filename = ... # type: str
funcName = ... # type: str
levelname = ... # type: str
levelno = ... # type: int
lineno = ... # type: int
module = ... # type: str
msecs = ... # type: int
message = ... # type: str
msg = ... # type: str
name = ... # type: str
pathname = ... # type: str
process = ... # type: int
processName = ... # type: str
relativeCreated = ... # type: int
if sys.version_info >= (3,):
stack_info = ... # type: Optional[str]
thread = ... # type: int
threadName = ... # type: str
if sys.version_info >= (3,):
def __init__(self, name: str, level: int, pathname: str, lineno: int,
msg: str, args: _ArgsType,
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...,
sinfo: Optional[str] = ...) -> None: ...
else:
def __init__(self, # type: ignore
name: str, level: int, pathname: str, lineno: int,
msg: str, args: _ArgsType,
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...) -> None: ...
def getMessage(self) -> str: ...
class LoggerAdapter:
def __init__(self, logger: Logger, extra: Mapping[str, Any]) -> None: ...
def process(self, msg: str, kwargs: MutableMapping[str, Any]) \
-> Tuple[str, MutableMapping[str, Any]]: ...
if sys.version_info > (3,):
def debug(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def info(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def warning(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def error(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def exception(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def critical(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def log(self, msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
else:
def debug(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def info(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def warning(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def error(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def exception(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def critical(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def log(self, # type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def isEnabledFor(self, lvl: int) -> None: ...
if sys.version_info >= (3,):
def getEffectiveLevel(self) -> int: ...
def setLevel(self, lvl: Union[int, str]) -> None: ...
def hasHandlers(self) -> bool: ...
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# def getLogger(name: Optional[str] = ...) -> Logger: ...
#else:
# @overload
# def getLogger() -> Logger: ...
# @overload
# def getLogger(name: str) -> Logger: ...
def getLogger(name: Optional[str] = ...) -> Logger: ...
def getLoggerClass() -> type: ...
if sys.version_info >= (3,):
def getLogRecordFactory() -> Callable[..., LogRecord]: ...
if sys.version_info > (3,):
def debug(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def info(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def warning(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def warn(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def error(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def critical(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def exception(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
def log(msg: str, *args: Any, exc_info: _ExcInfoType = ...,
stack_info: bool = ..., extra: Dict[str, Any] = ...,
**kwargs: Any) -> None: ...
else:
def debug(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def info(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def warning(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def warn(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def error(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def critical(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def exception(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def log(# type: ignore
msg: str, *args: Any, exc_info: _ExcInfoType = ...,
extra: Dict[str, Any] = ..., **kwargs: Any) -> None: ...
def disable(lvl: int) -> None: ...
def addLevelName(lvl: int, levelName: str) -> None: ...
def getLevelName(lvl: int) -> str: ...
def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ...
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# def basicConfig(*, filename: str = ..., filemode: str = ...,
# format: str = ..., datefmt: str = ..., style: str = ...,
# level: int = ..., stream: TextIO = ...,
# handlers: Iterable[Handler]) -> None: ...
#else:
# @overload
# def basicConfig() -> None: ...
# @overload
# def basicConfig(*, filename: str = ..., filemode: str = ...,
# format: str = ..., datefmt: str = ...,
# level: int = ..., stream: TextIO = ...) -> None: ...
def basicConfig(*, filename: str = ..., filemode: str = ...,
format: str = ..., datefmt: str = ..., style: str = ...,
level: int = ..., stream: TextIO = ...,
handlers: Iterable[Handler]) -> None: ...
def shutdown() -> None: ...
def setLoggerClass(klass: type) -> None: ...
if sys.version_info >= (3,):
def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ...
if sys.version_info >= (3,):
lastResort = ... # type: Optional['StreamHandler']
class StreamHandler(Handler):
def __init__(self, stream: Optional[TextIO] = ...) -> None: ...
class FileHandler(Handler):
def __init__(self, filename: str, mode: str = ...,
encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
class NullHandler(Handler): ...

View File

@@ -0,0 +1,29 @@
# Stubs for logging.config (Python 3.4)
from typing import Any, Callable, Dict, Optional, TextIO, Union
import sys
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# from configparser import RawConfigParser
#else:
# from ConfigParser import RawConfigParser
# TODO add RawConfigParser to configparser stubs
RawConfigParser = Any
def dictConfig(config: Dict[str, Any]) -> None: ...
if sys.version_info >= (3, 4):
def fileConfig(fname: Union[str, TextIO, RawConfigParser],
defaults: Optional[Dict[str, str]] = ...,
disable_existing_loggers: bool = ...) -> None: ...
def listen(port: int = ...,
verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) \
-> None: ...
else:
def fileConfig( # type: ignore
fname: Union[str, TextIO],
defaults: Optional[Dict[str, str]] = ...,
disable_existing_loggers: bool = ...) -> None: ...
def listen( # type: ignore
port: int = ...) -> None: ...
def stopListening() -> None: ...

View File

@@ -0,0 +1,223 @@
## Stubs for logging.handlers (Python 2.4)
from typing import Any, Callable, Optional, Tuple, Union, overload
from logging import Handler, FileHandler, LogRecord
import datetime
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# from queue import Queue
#else:
# from Queue import Queue
Queue = Any
from socket import SocketType
# TODO update socket stubs to add SocketKind
SocketKind = int
import ssl
import sys
class WatchedFileHandler(Handler):
@overload
def __init__(self, filename: str) -> None: ...
@overload
def __init__(self, filename: str, mode: str) -> None: ...
@overload
def __init__(self, filename: str, mode: str,
encoding: Optional[str]) -> None: ...
@overload
def __init__(self, filename: str, mode: str, encoding: Optional[str],
delay: bool) -> None: ...
if sys.version_info >= (3,):
class BaseRotatingHandler(FileHandler):
namer = ... # type: Optional[Callable[[str], None]]
rotator = ... # type: Optional[Callable[[str, str], None]]
def __init__(self, filename: str, mode: str,
encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def rotation_filename(self, default_name: str) -> None: ...
def rotate(self, source: str, dest: str) -> None: ...
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# class RotatingFileHandler(BaseRotatingHandler):
# def __init__(self, filename: str, mode: str = ..., maxBytes: int = ...,
# backupCount: int = ..., encoding: Optional[str] = ...,
# delay: bool = ...) -> None: ...
# def doRollover(self) -> None: ...
#else:
# class RotatingFileHandler(Handler):
# def __init__(self, filename: str, mode: str = ..., maxBytes: int = ...,
# backupCount: int = ..., encoding: Optional[str] = ...,
# delay: bool = ...) -> None: ...
# def doRollover(self) -> None: ...
class RotatingFileHandler(BaseRotatingHandler):
def __init__(self, filename: str, mode: str = ..., maxBytes: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def doRollover(self) -> None: ...
# TODO uncomment when mypy handle conditionals
#if sys.version_info >= (3,):
# class TimedRotatingFileHandler(BaseRotatingHandler):
# if sys.version_info >= (3, 4):
# def __init__(self, filename: str, when: str = ...,
# interval: int = ...,
# backupCount: int = ..., encoding: Optional[str] = ...,
# delay: bool = ..., utc: bool = ...,
# atTime: Optional[datetime.datetime] = ...) -> None: ...
# else:
# def __init__(self, # type: ignore
# filename: str, when: str = ..., interval: int = ...,
# backupCount: int = ..., encoding: Optional[str] = ...,
# delay: bool = ..., utc: bool = ...) -> None: ...
# def doRollover(self) -> None: ...
#else:
# class TimedRotatingFileHandler:
# def __init__(self, # type: ignore
# filename: str, when: str = ..., interval: int = ...,
# backupCount: int = ..., encoding: Optional[str] = ...,
# delay: bool = ..., utc: bool = ...) -> None: ...
# def doRollover(self) -> None: ...
class TimedRotatingFileHandler(BaseRotatingHandler):
if sys.version_info >= (3, 4):
def __init__(self, filename: str, when: str = ...,
interval: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ..., utc: bool = ...,
atTime: Optional[datetime.datetime] = ...) -> None: ...
else:
def __init__(self, # type: ignore
filename: str, when: str = ..., interval: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ..., utc: bool = ...) -> None: ...
def doRollover(self) -> None: ...
class SocketHandler(Handler):
retryStart = ... # type: float
retryFactor = ... # type: float
retryMax = ... # type: float
if sys.version_info >= (3, 4):
def __init__(self, host: str, port: Optional[int]) -> None: ...
else:
def __init__(self, host: str, port: int) -> None: ...
def makeSocket(self) -> SocketType: ...
def makePickle(self, record: LogRecord) -> bytes: ...
def send(self, packet: bytes) -> None: ...
def createSocket(self) -> None: ...
class DatagramHandler(SocketHandler): ...
class SysLogHandler(Handler):
LOG_ALERT = ... # type: int
LOG_CRIT = ... # type: int
LOG_DEBUG = ... # type: int
LOG_EMERG = ... # type: int
LOG_ERR = ... # type: int
LOG_INFO = ... # type: int
LOG_NOTICE = ... # type: int
LOG_WARNING = ... # type: int
LOG_AUTH = ... # type: int
LOG_AUTHPRIV = ... # type: int
LOG_CRON = ... # type: int
LOG_DAEMON = ... # type: int
LOG_FTP = ... # type: int
LOG_KERN = ... # type: int
LOG_LPR = ... # type: int
LOG_MAIL = ... # type: int
LOG_NEWS = ... # type: int
LOG_SYSLOG = ... # type: int
LOG_USER = ... # type: int
LOG_UUCP = ... # type: int
LOG_LOCAL0 = ... # type: int
LOG_LOCAL1 = ... # type: int
LOG_LOCAL2 = ... # type: int
LOG_LOCAL3 = ... # type: int
LOG_LOCAL4 = ... # type: int
LOG_LOCAL5 = ... # type: int
LOG_LOCAL6 = ... # type: int
LOG_LOCAL7 = ... # type: int
def __init__(self, address: Union[Tuple[str, int], str] = ...,
facility: int = ..., socktype: SocketKind = ...) -> None: ...
def encodePriority(self, facility: Union[int, str],
priority: Union[int, str]) -> int: ...
def mapPriority(self, levelName: int) -> str: ...
class NTEventLogHandler(Handler):
def __init__(self, appname: str, dllname: str = ...,
logtype: str = ...) -> None: ...
def getEventCategory(self, record: LogRecord) -> int: ...
# TODO correct return value?
def getEventType(self, record: LogRecord) -> int: ...
def getMessageID(self, record: LogRecord) -> int: ...
class SMTPHandler(Handler):
# TODO `secure` can also be an empty tuple
if sys.version_info >= (3,):
def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str,
toaddrs: List[str], subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] =...,
timeout: float = ...) -> None: ...
else:
def __init__(self, # type: ignore
mailhost: Union[str, Tuple[str, int]], fromaddr: str,
toaddrs: List[str], subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] =...) \
-> None: ...
def getSubject(self, record: LogRecord) -> str: ...
class BufferingHandler(Handler):
def __init__(self, capacity: int) -> None: ...
def shouldFlush(self, record: LogRecord) -> bool: ...
class MemoryHandler(BufferingHandler):
def __init__(self, capacity: int, flushLevel: int = ...,
target: Optional[Handler] =...) -> None: ...
def setTarget(self, target: Handler) -> None: ...
class HTTPHandler(Handler):
if sys.version_info >= (3, 5):
def __init__(self, host: str, url: str, method: str = ...,
secure: bool = ...,
credentials: Optional[Tuple[str, str]] = ...,
context: Optional[ssl.SSLContext] = ...) -> None: ...
elif sys.version_info >= (3,):
def __init__(self, # type: ignore
host: str, url: str, method: str = ..., secure: bool = ...,
credentials: Optional[Tuple[str, str]] = ...) -> None: ...
else:
def __init__(self, # type: ignore
host: str, url: str, method: str = ...) -> None: ...
def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ...
if sys.version_info > (3,):
class QueueHandler(Handler):
def __init__(self, queue: Queue) -> None: ...
def prepare(self, record: LogRecord) -> Any: ...
def enqueue(self, record: LogRecord) -> None: ...
class QueueListener:
if sys.version_info >= (3, 5):
def __init__(self, queue: Queue, *handlers: Handler,
respect_handler_level: bool = ...) -> None: ...
else:
def __init__(self, # type: ignore
queue: Queue, *handlers: Handler) -> None: ...
def dequeue(self, block: bool) -> LogRecord: ...
def prepare(self, record: LogRecord) -> Any: ...
def start(self) -> None: ...
def stop(self) -> None: ...
def enqueue_sentinel(self) -> None: ...

View File

@@ -1,239 +0,0 @@
# Stubs for logging (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
CRITICAL = ... # type: Any
FATAL = ... # type: Any
ERROR = ... # type: Any
WARNING = ... # type: Any
WARN = ... # type: Any
INFO = ... # type: Any
DEBUG = ... # type: Any
NOTSET = ... # type: Any
def getLevelName(level): ...
def addLevelName(level, levelName): ...
class LogRecord:
name = ... # type: Any
msg = ... # type: Any
args = ... # type: Any
levelname = ... # type: Any
levelno = ... # type: Any
pathname = ... # type: Any
filename = ... # type: Any
module = ... # type: Any
exc_info = ... # type: Any
exc_text = ... # type: Any
stack_info = ... # type: Any
lineno = ... # type: Any
funcName = ... # type: Any
created = ... # type: Any
msecs = ... # type: Any
relativeCreated = ... # type: Any
thread = ... # type: Any
threadName = ... # type: Any
processName = ... # type: Any
process = ... # type: Any
def __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=..., sinfo=...,
**kwargs): ...
def getMessage(self): ...
def setLogRecordFactory(factory): ...
def getLogRecordFactory(): ...
def makeLogRecord(dict): ...
class PercentStyle:
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def __init__(self, fmt) -> None: ...
def usesTime(self): ...
def format(self, record): ...
class StrFormatStyle(PercentStyle):
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def format(self, record): ...
class StringTemplateStyle(PercentStyle):
default_format = ... # type: Any
asctime_format = ... # type: Any
asctime_search = ... # type: Any
def __init__(self, fmt) -> None: ...
def usesTime(self): ...
def format(self, record): ...
BASIC_FORMAT = ... # type: Any
class Formatter:
converter = ... # type: Any
datefmt = ... # type: Any
def __init__(self, fmt=..., datefmt=..., style=...) -> None: ...
default_time_format = ... # type: Any
default_msec_format = ... # type: Any
def formatTime(self, record, datefmt=...): ...
def formatException(self, ei): ...
def usesTime(self): ...
def formatMessage(self, record): ...
def formatStack(self, stack_info): ...
def format(self, record): ...
class BufferingFormatter:
linefmt = ... # type: Any
def __init__(self, linefmt=...) -> None: ...
def formatHeader(self, records): ...
def formatFooter(self, records): ...
def format(self, records): ...
class Filter:
name = ... # type: Any
nlen = ... # type: Any
def __init__(self, name=...) -> None: ...
def filter(self, record): ...
class Filterer:
filters = ... # type: Any
def __init__(self) -> None: ...
def addFilter(self, filter): ...
def removeFilter(self, filter): ...
def filter(self, record): ...
class Handler(Filterer):
level = ... # type: Any
formatter = ... # type: Any
def __init__(self, level=...) -> None: ...
def get_name(self): ...
def set_name(self, name): ...
name = ... # type: Any
lock = ... # type: Any
def createLock(self): ...
def acquire(self): ...
def release(self): ...
def setLevel(self, level): ...
def format(self, record): ...
def emit(self, record): ...
def handle(self, record): ...
def setFormatter(self, fmt): ...
def flush(self): ...
def close(self): ...
def handleError(self, record): ...
class StreamHandler(Handler):
terminator = ... # type: Any
stream = ... # type: Any
def __init__(self, stream=...) -> None: ...
def flush(self): ...
def emit(self, record): ...
class FileHandler(StreamHandler):
baseFilename = ... # type: Any
mode = ... # type: Any
encoding = ... # type: Any
delay = ... # type: Any
stream = ... # type: Any
def __init__(self, filename, mode=..., encoding=..., delay=...) -> None: ...
def close(self): ...
def emit(self, record): ...
class _StderrHandler(StreamHandler):
def __init__(self, level=...) -> None: ...
lastResort = ... # type: Any
class PlaceHolder:
loggerMap = ... # type: Any
def __init__(self, alogger) -> None: ...
def append(self, alogger): ...
def setLoggerClass(klass): ...
def getLoggerClass(): ...
class Manager:
root = ... # type: Any
disable = ... # type: Any
emittedNoHandlerWarning = ... # type: Any
loggerDict = ... # type: Any
loggerClass = ... # type: Any
logRecordFactory = ... # type: Any
def __init__(self, rootnode) -> None: ...
def getLogger(self, name): ...
def setLoggerClass(self, klass): ...
def setLogRecordFactory(self, factory): ...
class Logger(Filterer):
name = ... # type: Any
level = ... # type: Any
parent = ... # type: Any
propagate = ... # type: Any
handlers = ... # type: Any
disabled = ... # type: Any
def __init__(self, name, level=...) -> None: ...
def setLevel(self, level): ...
def debug(self, msg, *args, **kwargs): ...
def info(self, msg, *args, **kwargs): ...
def warning(self, msg, *args, **kwargs): ...
def warn(self, msg, *args, **kwargs): ...
def error(self, msg, *args, **kwargs): ...
def exception(self, msg, *args, **kwargs): ...
def critical(self, msg, *args, **kwargs): ...
fatal = ... # type: Any
def log(self, level, msg, *args, **kwargs): ...
def findCaller(self, stack_info=...): ...
def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=..., extra=...,
sinfo=...): ...
def handle(self, record): ...
def addHandler(self, hdlr): ...
def removeHandler(self, hdlr): ...
def hasHandlers(self): ...
def callHandlers(self, record): ...
def getEffectiveLevel(self): ...
def isEnabledFor(self, level): ...
def getChild(self, suffix): ...
class RootLogger(Logger):
def __init__(self, level) -> None: ...
class LoggerAdapter:
logger = ... # type: Any
extra = ... # type: Any
def __init__(self, logger, extra) -> None: ...
def process(self, msg, kwargs): ...
def debug(self, msg, *args, **kwargs): ...
def info(self, msg, *args, **kwargs): ...
def warning(self, msg, *args, **kwargs): ...
def warn(self, msg, *args, **kwargs): ...
def error(self, msg, *args, **kwargs): ...
def exception(self, msg, *args, **kwargs): ...
def critical(self, msg, *args, **kwargs): ...
def log(self, level, msg, *args, **kwargs): ...
def isEnabledFor(self, level): ...
def setLevel(self, level): ...
def getEffectiveLevel(self): ...
def hasHandlers(self): ...
def basicConfig(**kwargs): ...
def getLogger(name=...): ...
def critical(msg, *args, **kwargs): ...
fatal = ... # type: Any
def error(msg, *args, **kwargs): ...
def exception(msg, *args, **kwargs): ...
def warning(msg, *args, **kwargs): ...
def warn(msg, *args, **kwargs): ...
def info(msg, *args, **kwargs): ...
def debug(msg, *args, **kwargs): ...
def log(level, msg, *args, **kwargs): ...
def disable(level): ...
class NullHandler(Handler):
def handle(self, record): ...
def emit(self, record): ...
lock = ... # type: Any
def createLock(self): ...
def captureWarnings(capture): ...

View File

@@ -1,200 +0,0 @@
# Stubs for logging.handlers (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
import logging
threading = ... # type: Any
DEFAULT_TCP_LOGGING_PORT = ... # type: Any
DEFAULT_UDP_LOGGING_PORT = ... # type: Any
DEFAULT_HTTP_LOGGING_PORT = ... # type: Any
DEFAULT_SOAP_LOGGING_PORT = ... # type: Any
SYSLOG_UDP_PORT = ... # type: Any
SYSLOG_TCP_PORT = ... # type: Any
class BaseRotatingHandler(logging.FileHandler):
mode = ... # type: Any
encoding = ... # type: Any
namer = ... # type: Any
rotator = ... # type: Any
def __init__(self, filename, mode, encoding=..., delay=...) -> None: ...
def emit(self, record): ...
def rotation_filename(self, default_name): ...
def rotate(self, source, dest): ...
class RotatingFileHandler(BaseRotatingHandler):
maxBytes = ... # type: Any
backupCount = ... # type: Any
def __init__(self, filename, mode=..., maxBytes=..., backupCount=..., encoding=...,
delay=...): ...
stream = ... # type: Any
def doRollover(self): ...
def shouldRollover(self, record): ...
class TimedRotatingFileHandler(BaseRotatingHandler):
when = ... # type: Any
backupCount = ... # type: Any
utc = ... # type: Any
atTime = ... # type: Any
interval = ... # type: Any
suffix = ... # type: Any
extMatch = ... # type: Any
dayOfWeek = ... # type: Any
rolloverAt = ... # type: Any
def __init__(self, filename, when=..., interval=..., backupCount=..., encoding=..., delay=...,
utc=..., atTime=...): ...
def computeRollover(self, currentTime): ...
def shouldRollover(self, record): ...
def getFilesToDelete(self): ...
stream = ... # type: Any
def doRollover(self): ...
class WatchedFileHandler(logging.FileHandler):
def __init__(self, filename, mode=..., encoding=..., delay=...) -> None: ...
stream = ... # type: Any
def emit(self, record): ...
class SocketHandler(logging.Handler):
host = ... # type: Any
port = ... # type: Any
address = ... # type: Any
sock = ... # type: Any
closeOnError = ... # type: Any
retryTime = ... # type: Any
retryStart = ... # type: Any
retryMax = ... # type: Any
retryFactor = ... # type: Any
def __init__(self, host, port) -> None: ...
def makeSocket(self, timeout=...): ...
retryPeriod = ... # type: Any
def createSocket(self): ...
def send(self, s): ...
def makePickle(self, record): ...
def handleError(self, record): ...
def emit(self, record): ...
def close(self): ...
class DatagramHandler(SocketHandler):
closeOnError = ... # type: Any
def __init__(self, host, port) -> None: ...
def makeSocket(self, timeout=...): ... # TODO: Actually does not have the timeout argument.
def send(self, s): ...
class SysLogHandler(logging.Handler):
LOG_EMERG = ... # type: Any
LOG_ALERT = ... # type: Any
LOG_CRIT = ... # type: Any
LOG_ERR = ... # type: Any
LOG_WARNING = ... # type: Any
LOG_NOTICE = ... # type: Any
LOG_INFO = ... # type: Any
LOG_DEBUG = ... # type: Any
LOG_KERN = ... # type: Any
LOG_USER = ... # type: Any
LOG_MAIL = ... # type: Any
LOG_DAEMON = ... # type: Any
LOG_AUTH = ... # type: Any
LOG_SYSLOG = ... # type: Any
LOG_LPR = ... # type: Any
LOG_NEWS = ... # type: Any
LOG_UUCP = ... # type: Any
LOG_CRON = ... # type: Any
LOG_AUTHPRIV = ... # type: Any
LOG_FTP = ... # type: Any
LOG_LOCAL0 = ... # type: Any
LOG_LOCAL1 = ... # type: Any
LOG_LOCAL2 = ... # type: Any
LOG_LOCAL3 = ... # type: Any
LOG_LOCAL4 = ... # type: Any
LOG_LOCAL5 = ... # type: Any
LOG_LOCAL6 = ... # type: Any
LOG_LOCAL7 = ... # type: Any
priority_names = ... # type: Any
facility_names = ... # type: Any
priority_map = ... # type: Any
address = ... # type: Any
facility = ... # type: Any
socktype = ... # type: Any
unixsocket = ... # type: Any
socket = ... # type: Any
formatter = ... # type: Any
def __init__(self, address=..., facility=..., socktype=...) -> None: ...
def encodePriority(self, facility, priority): ...
def close(self): ...
def mapPriority(self, levelName): ...
ident = ... # type: Any
append_nul = ... # type: Any
def emit(self, record): ...
class SMTPHandler(logging.Handler):
username = ... # type: Any
fromaddr = ... # type: Any
toaddrs = ... # type: Any
subject = ... # type: Any
secure = ... # type: Any
timeout = ... # type: Any
def __init__(self, mailhost, fromaddr, toaddrs, subject, credentials=..., secure=...,
timeout=...): ...
def getSubject(self, record): ...
def emit(self, record): ...
class NTEventLogHandler(logging.Handler):
appname = ... # type: Any
dllname = ... # type: Any
logtype = ... # type: Any
deftype = ... # type: Any
typemap = ... # type: Any
def __init__(self, appname, dllname=..., logtype=...) -> None: ...
def getMessageID(self, record): ...
def getEventCategory(self, record): ...
def getEventType(self, record): ...
def emit(self, record): ...
def close(self): ...
class HTTPHandler(logging.Handler):
host = ... # type: Any
url = ... # type: Any
method = ... # type: Any
secure = ... # type: Any
credentials = ... # type: Any
def __init__(self, host, url, method=..., secure=..., credentials=...) -> None: ...
def mapLogRecord(self, record): ...
def emit(self, record): ...
class BufferingHandler(logging.Handler):
capacity = ... # type: Any
buffer = ... # type: Any
def __init__(self, capacity) -> None: ...
def shouldFlush(self, record): ...
def emit(self, record): ...
def flush(self): ...
def close(self): ...
class MemoryHandler(BufferingHandler):
flushLevel = ... # type: Any
target = ... # type: Any
def __init__(self, capacity, flushLevel=..., target=...) -> None: ...
def shouldFlush(self, record): ...
def setTarget(self, target): ...
buffer = ... # type: Any
def flush(self): ...
def close(self): ...
class QueueHandler(logging.Handler):
queue = ... # type: Any
def __init__(self, queue) -> None: ...
def enqueue(self, record): ...
def prepare(self, record): ...
def emit(self, record): ...
class QueueListener:
queue = ... # type: Any
handlers = ... # type: Any
def __init__(self, queue, *handlers) -> None: ...
def dequeue(self, block): ...
def start(self): ...
def prepare(self, record): ...
def handle(self, record): ...
def enqueue_sentinel(self): ...
def stop(self): ...