@@ -184,7 +184,7 @@ def __init__(
184184 """
185185 ## logging.Formatter compatibility
186186 ## ---------------------------------------------------------------------
187- # Note: validate added in 3.8, defaults added in 3.10
187+ # Note: validate added in python 3.8, defaults added in 3.10
188188 if style in logging ._STYLES :
189189 _style = logging ._STYLES [style ][0 ](fmt ) # type: ignore[operator]
190190 if validate :
@@ -196,6 +196,8 @@ def __init__(
196196 self ._style = style
197197 self ._fmt = fmt
198198
199+ # TODO: Validate comma format
200+
199201 else :
200202 raise ValueError (f"Style must be one of: { ',' .join (logging ._STYLES .keys ())} " )
201203
@@ -278,15 +280,9 @@ def parse(self) -> List[str]:
278280 list of fields to be extracted and serialized
279281 """
280282 if self ._fmt is None :
281- # TODO: does it matter that we do this before checking if the style is valid?
282- # (we already (mostly) check for valid style names in __init__
283283 return []
284284
285285 if isinstance (self ._style , str ) and self ._style == "," :
286- # TODO: should we check that there are no empty fields?
287- # If yes we should do this in __init__ where we validate other styles?
288- # Do we drop empty fields?
289- # etc
290286 return [field .strip () for field in self ._fmt .split ("," ) if field .strip ()]
291287
292288 if isinstance (self ._style , logging .StringTemplateStyle ):
0 commit comments