Skip to content

Instantly share code, notes, and snippets.

@nickcheng
Created November 12, 2012 12:50
Show Gist options
  • Save nickcheng/4059236 to your computer and use it in GitHub Desktop.
Save nickcheng/4059236 to your computer and use it in GitHub Desktop.
Global log level configuration for CocoaLumberjack

How to use

  • Put these 2 files into your project.
  • Add #import "LoggingConfig.h" to your {ProjectName}-Prefix.pch file in your project.

You'll no longer need to define ddLogLevel in every file any more.

//
// LoggingConfig.h
//
// Created by nickcheng on 12-11-12.
// Copyright (c) 2012年 nx. All rights reserved.
//
#import "DDLog.h"
extern int const ddLogLevel;
//
// LoggingConfig.m
//
// Created by nickcheng on 12-11-12.
// Copyright (c) 2012年 nx. All rights reserved.
//
#import "LoggingConfig.h"
#ifdef DEBUG
int const ddLogLevel = LOG_LEVEL_VERBOSE;
#else
int const ddLogLevel = LOG_LEVEL_WARN;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment