Skip to content

How to use an existing Logger? #444

Answered by kneekey23
0xTim asked this question in Q&A
Oct 12, 2021 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

ah I think what you are asking is if you have an existing logger and you do not want to use the SDK's logger. In that case, you need to conform your logger to the LogAgent protocol that exists in the ClientRuntime module.

public protocol LogAgent {
    /// name of the struct or class where the logger was instantiated from
    var name: String {get}
    
    /// Get or set the configured log level.
    var level: LogLevel {get set}
    
    /// This method is called when a `LogAgent` must emit a log message.
    ///
    /// - parameters:
    ///     - level: The `LogLevel` the message was logged at.
    ///     - message: The message to log.
    ///     - metadata: The metadata associated …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@0xTim
Comment options

@kneekey23
Comment options

@0xTim
Comment options

Answer selected by 0xTim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants