Skip to content

Disabling logging

Tyler Fox edited this page Jul 23, 2015 · 5 revisions

By default, in Debug builds only, INTULocationManager will log info to the console when significant events occur. If you'd like to completely disable logging for INTULocationManager, you simply need to define the preprocessor macro INTU_ENABLE_LOGGING=0.

Here are the steps to do this:

If you're using CocoaPods

You probably don't want to modify the Pods project (and the Pods-INTULocationManager target it contains) by hand because it is regenerated every time you run pod install. Instead, you should use a post_install hook to have the preprocessor macro automatically added every time you run pod install.

At the end of your Podfile, add the following post_install hook:

post_install do |installer_representation|
  # NOTE: If you are using a CocoaPods version prior to 0.38, replace `pods_project` with `project` on the below line
  installer_representation.pods_project.targets.each do |target|
    if target.name.end_with? "INTULocationManager"
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'INTU_ENABLE_LOGGING=0']
      end
    end
  end
end

The above post_install hook will define the macro INTU_ENABLE_LOGGING=0 for every build configuration on all INTULocationManager targets in the generated Pods project.

If you've integrated the source code directly into your project

  1. In Xcode, click on your Project
  2. Click on the Target for your app
  3. Click Build Settings
  4. Find (or search) Preprocessor Macros under Apple LLVM 6.0 - Preprocessing
  5. For all build configurations (Debug & Release) add the macro: INTU_ENABLE_LOGGING=0

Now, even in Debug builds, PureLayout will not log to the console.