Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a Recordable interface for Logs #412

Closed
kxyr opened this issue Dec 1, 2020 · 2 comments
Closed

Implementing a Recordable interface for Logs #412

kxyr opened this issue Dec 1, 2020 · 2 comments

Comments

@kxyr
Copy link
Contributor

kxyr commented Dec 1, 2020

Problem
An important use case of logging is to allow log records to be sent to multiple export destinations, as seen in these logging libraries:

In the current Logging SDK, a LogRecord is created as a unique_pointer by the SDK, then moved to a processor, then passed by const reference to an exporter. This implementation does not allow more than one processor per Logger.

Solution
One solution could be to implement a Recordable interface, similar to what is currently used for traces. The recordable idea outlined here.

Alternatives Considered
Another possible (simpler but less performant) solution is to pass a LogRecord as a shared_ptr to be shared between the multiple processors/exporters. However, this approach could offer inconsistent performance related to memory-management which is a goal.

Additional Context
Further discussion about the Recordable interface can be found in #44 and #49.

cc @alolita @MarkSeufert

@meastp
Copy link
Contributor

meastp commented Dec 3, 2020

@xukaren I don't know if you think it's relevant, as you already have a multiple examples, but Boost.Log is also designed around multiple sinks / export destinations as seen in the Boost.Log design overview documentation.

@kxyr
Copy link
Contributor Author

kxyr commented Dec 14, 2020

Resolved by #438

@kxyr kxyr closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants