Skip to content

FluentRecordFormatter not compatible with Python 3.2+ Formatter #63

@jt1

Description

@jt1

From Python 3.2 logging.Formatter __init__ method has extra parameter style:

def __init__(self, fmt=None, datefmt=None, style='%'):

but fluent.handler.FluentRecordFormatter does not have it:

def __init__(self, fmt=None, datefmt=None):

Problem appears when reading logging configuration from a ConfigParser-format file using
logging.fileConfig (e.g. loading logging configuration from Pyramid ini file).
When logging.config._create_formatters runs f = c(fs, dfs, stl) following exception is raised:
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given

I suggest to add style parameter to fluent.handler.FluentRecordFormatter __init__ definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions