You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a debugger is attached, I'd like to see logs about certain events (e.g. initializations, notifications) produced by the Capable framework. Furthermore, it would be great expose an API to set my own logger implementation.
How does it work in detail?
By default, the framework uses the default logger implementation build upon os.log. If the debugger is attached, this will log different events (verbose, info, warning, error) coming from the framework code to the console.
If the dev needs to provide her own logger implementation, she can do so by providing a closure.
Also, setting a minimum log level should be supported: if the dev only wants the Capable framework to log warning or errors, she needs to set the log level to warnings.
What does the API look like?
Custom log closure
var log: (message: String, logLevel: OSLogType) -> () = { message, logLevel in
MyCustomLogger.logToFile(component: "Capable", message: message, type: logLevel)
}
let capable = Capable()
capable.onLog = log
capable.logLevel = OS_LOG_TYPE_INFO
Any existing projects that do something similar?
Most SDKs.
The text was updated successfully, but these errors were encountered:
What kind of feature would you like to see?
When a debugger is attached, I'd like to see logs about certain events (e.g. initializations, notifications) produced by the Capable framework. Furthermore, it would be great expose an API to set my own logger implementation.
How does it work in detail?
By default, the framework uses the default logger implementation build upon os.log. If the debugger is attached, this will log different events (verbose, info, warning, error) coming from the framework code to the console.
If the dev needs to provide her own logger implementation, she can do so by providing a closure.
Also, setting a minimum log level should be supported: if the dev only wants the Capable framework to log warning or errors, she needs to set the log level to warnings.
What does the API look like?
Custom log closure
Any existing projects that do something similar?
Most SDKs.
The text was updated successfully, but these errors were encountered: