Adds logging PlaceHolder class and Logger attributes (#472)

Adds several attributes which were missing from the Logger types,
including "name", "level", and "parent". Because the type of "parent"
is a union of Logger and PlaceHolder, we also define types for
PlaceHolder and all of it's methods.
This commit is contained in:
Tyler O'Meara
2016-08-15 11:42:02 -07:00
committed by Matthias Kramm
parent 219c57a28c
commit 1bb090d6f8

View File

@@ -19,7 +19,12 @@ _FilterType = Union['Filter', Callable[[LogRecord], int]]
class Logger:
name = ... # type: str
level = ... # type: int
parent = ... # type: Union[Logger, PlaceHolder]
propagate = ... # type: bool
handlers = ... # type: List[Handler]
disabled = ... # type: int
def setLevel(self, lvl: Union[int, str]) -> None: ...
def isEnabledFor(self, lvl: int) -> None: ...
def getEffectiveLevel(self) -> int: ...
@@ -334,3 +339,8 @@ class FileHandler(Handler):
class NullHandler(Handler): ...
class PlaceHolder:
def __init__(self, alogger: Logger) -> None: ...
def append(self, alogger: Logger) -> None: ...