Better debug information with Symbol Logging for Swift code
Usage:
This logging function can be called anywhere in your code like this:
symLog(1, "first symLog test") // try 1..80 as first param
Parameter 0 mutes logging
Put
private let symLog = SymLogC() // parameter 0 mutes logging
at the top of your Swift class/struct.
Put log calls in your code like this:
symLog.log("your message here")
or
symLog.log()
or
symLog.log(Any_Class)
or
symLog.log("your message with param \(Any_Class) and newlines \n\n")
If you want to (temporarely) stop logging for this class, add a parameter "0" like this:
private let symLog = SymLogC(0) // parameter 0 mutes logging
The .log function calls in this class will be muted.
import SwiftUI
import SymLog
struct ContentView: View {
private let symLog = SymLogV() // parameter 0 mutes logging
var body: some View {
symLog {
VStack {
or
symLog {
NavigationView {
Since SymLogV inherits from SymLogC, you can use the class logging function also for debugging Swift logic in your SwiftUI view definitions. Just call
symLog.log("your message here")