Skip to content

Instantly share code, notes, and snippets.

@fcaldarelli
Created April 9, 2016 11:31
Show Gist options
  • Save fcaldarelli/605227c4847525ad053bb5b384161656 to your computer and use it in GitHub Desktop.
Save fcaldarelli/605227c4847525ad053bb5b384161656 to your computer and use it in GitHub Desktop.
Logger Macro for iOS
//
// Logger.h
// SlotCore
//
// Created by Fabrizio on 08/04/16.
// Copyright © 2016 Fabrizio Caldarelli. All rights reserved.
//
#ifndef Logger_h
#define Logger_h
// Definisce forme più specifiche per il debug
#ifdef DEBUG
#define LogInfo(category, fmt, ...) NSLog((@"[%@] " fmt), category, ##__VA_ARGS__);
#define LogErr(fmt, ...) NSLog((@"[ERR] %s[Ln %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#endif
// Disabilita NSLog quando non si è in modalità DEBUG
#ifndef DEBUG
#define NSLog(...);
#endif
#endif /* Logger_h */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment