summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index d6315b0..432fefc 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -25,6 +25,7 @@ To use, simply 'import logging' and log away!
import sys, os, time, io, re, traceback, warnings, weakref, collections.abc
+from types import GenericAlias
from string import Template
from string import Formatter as StrFormatter
@@ -1145,6 +1146,8 @@ class StreamHandler(Handler):
name += ' '
return '<%s %s(%s)>' % (self.__class__.__name__, name, level)
+ __class_getitem__ = classmethod(GenericAlias)
+
class FileHandler(StreamHandler):
"""
@@ -1939,6 +1942,8 @@ class LoggerAdapter(object):
level = getLevelName(logger.getEffectiveLevel())
return '<%s %s (%s)>' % (self.__class__.__name__, logger.name, level)
+ __class_getitem__ = classmethod(GenericAlias)
+
root = RootLogger(WARNING)
Logger.root = root
Logger.manager = Manager(Logger.root)