robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

How to turn off Xcode console logging, when installed with cocoapods. #1188

Open asadali737 opened 4 years ago

asadali737 commented 4 years ago

Hi,

I am using pod 'XMPPFramework/Swift', '4.0.0' in my swift project. pod version: 1.9.3 Xcode version: 11.7 (11E801a)

I want to turn off the logging in Xcode console. How to turn that off? I tried following ways, but nothing worked.

In AppDelegate.swift DDLog.add(DDTTYLogger.sharedInstance!, with: DDLogLevel(rawValue: DDLogLevel.RawValue(XMPP_LOG_LEVEL_OFF)) ?? .off)

In XMPPLogging.h

#ifndef XMPP_LOGGING_ENABLED
#define XMPP_LOGGING_ENABLED 0
#endif

In Pod file

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "XMPPFramework"
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'XMPP_LOGGING_ENABLED=0']
      end
    end
  end
end

I just want to completely get rid of that logging. Any help would greatly be appreciated.