Using os_log to log function arguments, or other dynamic data

前端 未结 5 1498
一向
一向 2021-01-03 00:24

I\'m trying to log function arguments into os_log like this:

func foo(x: String, y: [String:String]) {
    //...
    os_log(\"foo: \\(x) \\(y.de         


        
5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 00:55

    This is my approach:

    import Foundation
    import os.log
    
    struct Log {
        enum LogLevel: String {
            case error = "⛔️"
            case warning = "⚠️"
            case debug = "

提交回复
热议问题