Skip to content

Instantly share code, notes, and snippets.

@fwhenin
Created December 18, 2014 15:58
Show Gist options
  • Save fwhenin/4e2161a9e6910e7926e3 to your computer and use it in GitHub Desktop.
Save fwhenin/4e2161a9e6910e7926e3 to your computer and use it in GitHub Desktop.
CocoaLumberJack wrapper for Swift
//
// DDLogWrapper.h
// DMS
//
// Created by Freddy on 12/18/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DDLogWrapper : NSObject
+ (void) logError:(NSString *)message;
+ (void) logWarn:(NSString *)message;
+ (void) logInfo:(NSString *)message;
+ (void) logDebug:(NSString *)message;
+ (void) logVerbose:(NSString *)message;
@end
//
// DDLogWrapper.m
// DMS
//
// Created by Freddy on 12/18/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
#import "DDLogWrapper.h"
// Logging Framework Lumberjack
#import "DDLog.h"
// Definition of the current log level
#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
#else
static const int ddLogLevel = LOG_LEVEL_ERROR;
#endif
@implementation DDLogWrapper
+ (void) logError:(NSString *)message {
DDLogError(message);
}
+ (void) logWarn:(NSString *)message {
DDLogWarn(message);
}
+ (void) logInfo:(NSString *)message {
DDLogInfo(message);
}
+ (void) logDebug:(NSString *)message {
DDLogDebug(message);
}
+ (void) logVerbose:(NSString *)message {
DDLogVerbose(message);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment