Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type not displayed in Console output on Mac for OSLogWriter #67

Open
kadanes opened this issue Feb 19, 2021 · 0 comments
Open

Type not displayed in Console output on Mac for OSLogWriter #67

kadanes opened this issue Feb 19, 2021 · 0 comments

Comments

@kadanes
Copy link

kadanes commented Feb 19, 2021

I am using Willow v6.0.0. In it, I am creating a release level logger like this:

private static func buildReleaseLogger(name: String) -> Logger {
        guard let bundleIdentifier =  Bundle.main.bundleIdentifier else {
            return buildDebugLogger(name: name)
        }
        
        let osLogWriter = OSLogWriter(subsystem: bundleIdentifier, category: name)
        
        let appLogLevels: LogLevel = [.event, .info, .warn, .error]
        let asynchronousExecution: Logger.ExecutionMethod = .asynchronous(
            queue: DispatchQueue(label: "speech-drill.logging", qos: .utility)
        )
        
        return Logger(logLevels: appLogLevels, writers: [osLogWriter], executionMethod: asynchronousExecution)
}

But when I open the console app on my Mac and change the build configuration to release, I see the type field empty when filtering by subsystem.

image

What am I missing in this setup? I have followed this guide: Convenient Logging in Swift and used the exact same code. The only changes are made in subsystem and queue label names. In the output for the tutorial, you can see the type of log which gets decided by log level. What am I missing?

This configure function is called in application(_:didFinishLaunchingWithOptions:) .

static func configure() {
        
        let name = "Logger"
       
        #if DEBUG
            willow_logger = buildDebugLogger(name: name)
        #else
            willow_logger = buildReleaseLogger(name: name)
        #endif
        
        willow_logger?.enabled = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant