How to disable logging with os_log

(Marcin Krzyzanowski) #1

When os_log is used, sourcekit-lsp logs everything (guess that's expected)

I'm not fluent in os_log setup (looking at macOS and Xcode). Is there a way to disable logs when spawning the sourcekit-lsp process? it all goes to the Xcode console and is super annoying ;P

PS. I know Tests uses Logger.disableOSLog to disable logs completely (I guess because it was too verbose in console)

(Josh Wisenbaker) #2

While you can adjust the levels some via profiles or the log command, I don't know that you can totally disable the default levels easily with os_log.

In that class disableOSLog is a bool that defaults to false. Is sourcekit-lsp looking for an environment variable or something when you run it to know if it should set that flag on the Logger class?

(Ben Langmuir) #3

The disableOSLog flag is only ever set to true during one specific test today, but patches welcome for making it configurable.

Sorry, I don't know off hand if it's possible to turn it off globally during Xcode debugging - I believe os_log behaves specially when running under the debugger, but I assume the configuration options @Josh_Wisenbaker mentioned would still apply.

(Marcin Krzyzanowski) #4

thanks. Noticed that, but it looks very cumbersome and system level, that why I asked.

shouldn't "os_log" specify "" or something like that to make it possible to filter it out with the "subsystems" ?