Skip to content

Should the handler use the log source? #3

Description

@lukeredpath

I notice that the current implementation uses a deprecated API that does not include the source parameter and instead passes the logger label to the underlying persistent log store.

This means in effect if you want to have differently labelled logs in Pulse you need to create a separate Logger for each with a unique label.

SwiftLog now has a source parameter and it recommends that the source is used to identify the origin of the log entry rather than the logger label which identifies who created the logger.

https://github.com/apple/swift-log#source-vs-label

Conceptually it feels like you should be able to create a single logger and pass it around different modules and use the source to distinguish between subsystems. This would require updating the log handler to pass the source as the log label instead.

I’d be happy to open a PR if you think this change is the right one. Or do you think distinct modules or subsystems should just create their own Logger instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions