Skip to content

Add a LoggingSink abstract type? #74

@oxinabox

Description

@oxinabox

Logging Sinks should always have:

shouldlog(::LoggingSink, arg...) = true
min_enabled_level(::LoggingSink = BelowMinLevel
catch_exceptions(filelogger::FileLogger) = true  # probably

(for the last see #38)

With a user defined:

handle_message(::MySink, args...; kwargs...) = ...

That is what makes them Sinks

So we could make it an abstract type all user sinks inherit from.

An alternative is we could make a generic sink that takes a function as it's argument, and then calls that function for handle_message, but that is uglier if they need to keep state, and disallows overriding catch_exceptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions