9

I'm getting a lot of output on the console as I run a MacOS based SwiftUI app I'm developing, for example:

2021-12-08 12:40:14.439565+0000 SpDriveApp[6801:159299] [] [0x7fe6e7830820] CVCGDisplayLink::setCurrentDisplay: 1892262333
2021-12-08 12:40:14.439785+0000 SpDriveApp[6801:159299] [] [0x7fe6e7830800] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x70c9a1bd] [CVCGDisplayLink: 0x7fe6e7830820]
2021-12-08 12:40:14.439827+0000 SpDriveApp[6801:159299] [] [0x7fe6e7830800] CVDisplayLinkStart
2021-12-08 12:40:14.439853+0000 SpDriveApp[6801:159299] [] [0x7fe6e7830820] CVDisplayLink::start
2021-12-08 12:40:14.439993+0000 SpDriveApp[6801:182706] [] [0x60000f698460] CVXTime::reset

Has anyone else seen this? Have I accidentally switched on a diagnostic tool, or is there something else I am doing wrong?

Philip Pegden
  • 1,732
  • 1
  • 14
  • 33
  • 1
    Im also seeing this since installing macOS 12.1. I have Core Data logging (`-com.apple.CoreData.SQLDebug 1` and `-com.apple.CoreData.Logging.stderr 1`). Only just noticed this myself, perhaps worth logging a feedback. – andrewbuilder Dec 11 '21 at 14:13
  • 1
    I'm seeing `CVDisplayLink` and `CVCGDisplayLink` messages that present in console when I scroll within a `ScrollView` (macOS target only). – andrewbuilder Dec 11 '21 at 15:28
  • 2
    Seeing this as well. I filed a feedback report about it: FB9810620 – Wevah Dec 16 '21 at 06:26

3 Answers3

6

I get these messages not because of SwiftUI, but because of a WKWebView, nevertheless this work around may work for both:

Add the 'Environment Variable': OS_ACTIVITY_MODE, with value: disable on Product > Scheme > Edit Scheme > Run > Arguments.

Editing the scheme to add environment variable

vicegax
  • 4,709
  • 28
  • 37
  • This "works", but it disables everything, from spam to useful warnings, autolayout errors, and my own logging. – Guilmo Mar 10 '22 at 17:44
  • @Guilmo it should not be the case. Most logs and warnings should still be visible, specially your own ones. Check that you haven't accidentally set a filter on the console (bottom right corner), otherwise restart Xcode and try some logging again. – vicegax Mar 10 '22 at 19:33
  • 1
    More information here https://stackoverflow.com/a/39651073/568462 tldr try using 'default' instead of 'disable' – borisgolovnev May 05 '22 at 16:41
0

There appears to be an alternative, more granular solution to using OS_ACTIVITY_MODE, but this one is global to your macOS installation. I found this on Daniel Jakult's blog Indie Stack:

You can disable these messages by running this in your terminal:

defaults write com.apple.corevideo cv_note 0
fresskoma
  • 25,481
  • 10
  • 85
  • 128
0

In my case it was enough to remove unused import which was automatically added by Xcode

import CloudKit