mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
logging: various fixes (#4196)
* logging.disable: update for py37 * RootLogger: fix __init__ * shutdown: add undocumented parameter * MemoryHandler: add flushOnClose in py36 * NTEventLogHandler: fix dllname type * makeSocket: add undocumented parameter * SysLogHandler: fix socktype type Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from typing import (
|
||||
Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO,
|
||||
Tuple, Text, Union, overload,
|
||||
Sequence, Tuple, Text, Union, overload,
|
||||
)
|
||||
from string import Template
|
||||
from time import struct_time
|
||||
@@ -490,7 +490,7 @@ else:
|
||||
def basicConfig(*, filename: Optional[str] = ..., filemode: str = ...,
|
||||
format: str = ..., datefmt: Optional[str] = ...,
|
||||
level: Optional[_Level] = ..., stream: IO[str] = ...) -> None: ...
|
||||
def shutdown() -> None: ...
|
||||
def shutdown(handlerList: Sequence[Any] = ...) -> None: ... # handlerList is undocumented
|
||||
|
||||
def setLoggerClass(klass: type) -> None: ...
|
||||
|
||||
@@ -533,7 +533,8 @@ class PlaceHolder:
|
||||
|
||||
# Below aren't in module docs but still visible
|
||||
|
||||
class RootLogger(Logger): ...
|
||||
class RootLogger(Logger):
|
||||
def __init__(self, level: int) -> None: ...
|
||||
|
||||
root: RootLogger
|
||||
|
||||
|
||||
@@ -93,13 +93,14 @@ class SocketHandler(Handler):
|
||||
def __init__(self, host: str, port: Optional[int]) -> None: ...
|
||||
else:
|
||||
def __init__(self, host: str, port: int) -> None: ...
|
||||
def makeSocket(self) -> SocketType: ...
|
||||
def makeSocket(self, timeout: float = ...) -> SocketType: ... # timeout is undocumented
|
||||
def makePickle(self, record: LogRecord) -> bytes: ...
|
||||
def send(self, s: bytes) -> None: ...
|
||||
def createSocket(self) -> None: ...
|
||||
|
||||
|
||||
class DatagramHandler(SocketHandler): ...
|
||||
class DatagramHandler(SocketHandler):
|
||||
def makeSocket(self) -> SocketType: ... # type: ignore
|
||||
|
||||
|
||||
class SysLogHandler(Handler):
|
||||
@@ -132,14 +133,14 @@ class SysLogHandler(Handler):
|
||||
LOG_LOCAL6: int
|
||||
LOG_LOCAL7: int
|
||||
def __init__(self, address: Union[Tuple[str, int], str] = ...,
|
||||
facility: int = ..., socktype: _SocketKind = ...) -> None: ...
|
||||
facility: int = ..., socktype: Optional[_SocketKind] = ...) -> None: ...
|
||||
def encodePriority(self, facility: Union[int, str],
|
||||
priority: Union[int, str]) -> int: ...
|
||||
def mapPriority(self, levelName: str) -> str: ...
|
||||
|
||||
|
||||
class NTEventLogHandler(Handler):
|
||||
def __init__(self, appname: str, dllname: str = ...,
|
||||
def __init__(self, appname: str, dllname: Optional[str] = ...,
|
||||
logtype: str = ...) -> None: ...
|
||||
def getEventCategory(self, record: LogRecord) -> int: ...
|
||||
# TODO correct return value?
|
||||
@@ -170,8 +171,12 @@ class BufferingHandler(Handler):
|
||||
def shouldFlush(self, record: LogRecord) -> bool: ...
|
||||
|
||||
class MemoryHandler(BufferingHandler):
|
||||
def __init__(self, capacity: int, flushLevel: int = ...,
|
||||
target: Optional[Handler] = ...) -> None: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(self, capacity: int, flushLevel: int = ...,
|
||||
target: Optional[Handler] = ..., flushOnClose: bool = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, capacity: int, flushLevel: int = ...,
|
||||
target: Optional[Handler] = ...) -> None: ...
|
||||
def setTarget(self, target: Handler) -> None: ...
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ importlib.resources
|
||||
io.StringIO.readline
|
||||
ipaddress._BaseNetwork.__init__
|
||||
json.loads
|
||||
logging.handlers.MemoryHandler.__init__
|
||||
mmap.ACCESS_DEFAULT
|
||||
multiprocessing.shared_memory
|
||||
nntplib._NNTPBase.starttls
|
||||
|
||||
@@ -40,7 +40,6 @@ http.server.SimpleHTTPRequestHandler.__init__
|
||||
importlib.metadata
|
||||
ipaddress._BaseNetwork.__init__
|
||||
json.loads
|
||||
logging.handlers.MemoryHandler.__init__
|
||||
macurl2path # removed in 3.7
|
||||
multiprocessing.shared_memory
|
||||
nntplib._NNTPBase.starttls
|
||||
|
||||
@@ -60,7 +60,6 @@ ipaddress.IPv4Interface.hostmask
|
||||
ipaddress.IPv6Interface.hostmask
|
||||
ipaddress._BaseNetwork.broadcast_address
|
||||
ipaddress._BaseNetwork.hostmask
|
||||
logging.handlers.MemoryHandler.__init__
|
||||
macpath
|
||||
macurl2path # removed in 3.7
|
||||
mmap.MADV_[A-Z_]+
|
||||
|
||||
@@ -113,7 +113,6 @@ ipaddress._BaseNetwork.hostmask
|
||||
itertools.tee
|
||||
logging.FileHandler.__init__
|
||||
logging.handlers.BaseRotatingHandler.__init__
|
||||
logging.handlers.MemoryHandler.__init__
|
||||
logging.handlers.RotatingFileHandler.__init__
|
||||
logging.handlers.TimedRotatingFileHandler.__init__
|
||||
logging.handlers.WatchedFileHandler.__init__
|
||||
|
||||
@@ -292,12 +292,6 @@ lib2to3.pytree.BasePattern.__new__
|
||||
lib2to3.pytree.BasePattern.type
|
||||
lib2to3.pytree.NegatedPattern.match
|
||||
lib2to3.pytree.NegatedPattern.match_seq
|
||||
logging.RootLogger.__init__
|
||||
logging.disable
|
||||
logging.handlers.NTEventLogHandler.__init__
|
||||
logging.handlers.SocketHandler.makeSocket
|
||||
logging.handlers.SysLogHandler.__init__
|
||||
logging.shutdown
|
||||
mailbox.Babyl.__init__
|
||||
mailbox.MH.__init__
|
||||
mailbox.MMDF.__init__
|
||||
|
||||
Reference in New Issue
Block a user