MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _create_formatters

Function _create_formatters

tools/python-3.11.9-amd64/Lib/logging/config.py:113–132  ·  view source on GitHub ↗

Create and return formatters

(cp)

Source from the content-addressed store, hash-verified

111 return map(str.strip, alist)
112
113def _create_formatters(cp):
114 """Create and return formatters"""
115 flist = cp["formatters"]["keys"]
116 if not len(flist):
117 return {}
118 flist = flist.split(",")
119 flist = _strip_spaces(flist)
120 formatters = {}
121 for form in flist:
122 sectname = "formatter_%s" % form
123 fs = cp.get(sectname, "format", raw=True, fallback=None)
124 dfs = cp.get(sectname, "datefmt", raw=True, fallback=None)
125 stl = cp.get(sectname, "style", raw=True, fallback='%')
126 c = logging.Formatter
127 class_name = cp[sectname].get("class")
128 if class_name:
129 c = _resolve(class_name)
130 f = c(fs, dfs, stl)
131 formatters[form] = f
132 return formatters
133
134
135def _install_handlers(cp, formatters):

Callers 1

fileConfigFunction · 0.85

Calls 4

_strip_spacesFunction · 0.85
_resolveFunction · 0.85
splitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected