Provides a logger for your Swift project
Add Logger as a Swift package dependency
https://github.com/lindebrothers/Logger
public func publish(message: String, obj: Any, level: LogLevel)
Debug
public func debug(_ obj: Any, functionName: String? = #function, line: Int? = #line, path: String? = #file)
Info
public func info(_ obj: Any, functionName: String? = #function, line: Int? = #line, path: String? = #file)
Warning
public func warning(_ obj: Any, functionName: String? = #function, line: Int? = #line, path: String? = #file)
Error
public func error(_ obj: Any, functionName: String? = #function, line: Int? = #line, path: String? = #file)
struct ContentView: View {
var body: some View {
Logger.InView("my message")
}
}
or use the log
modifier
struct ContentView: View {
var body: some View {
Color.log("My message")
}
}