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

@@ -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: ...