summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLLogMacros.h
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-03-02 16:00:01 -0500
committerJoel Fischer <joeljfischer@gmail.com>2017-03-02 16:00:01 -0500
commit2bce4d3fb5699b3771fb854b0e2ef3477b949445 (patch)
treeaf9558336b09cda62a588869b12b275e1c203043 /SmartDeviceLink/SDLLogMacros.h
parent461e7c4c555b2cbee58cfa1b1d13cb1d70eb35c0 (diff)
downloadsdl_ios-2bce4d3fb5699b3771fb854b0e2ef3477b949445.tar.gz
Delete old logging files
* This does not build * Module map stubs for SDL files * Moved macros to their own file
Diffstat (limited to 'SmartDeviceLink/SDLLogMacros.h')
-rw-r--r--SmartDeviceLink/SDLLogMacros.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLLogMacros.h b/SmartDeviceLink/SDLLogMacros.h
new file mode 100644
index 000000000..6bf0ecd0e
--- /dev/null
+++ b/SmartDeviceLink/SDLLogMacros.h
@@ -0,0 +1,35 @@
+//
+// SDLLogMacros.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 3/2/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#pragma mark - Macros
+
+#pragma mark - General Macros
+#define SDLLOG_FILE [[[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lastPathComponent] stringByDeletingPathExtension]
+#define SDLLOG_FUNC [NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding]
+
+#pragma mark Debug Logs
+
+#if DEBUG
+
+#define SDLLogV(msg, ...) [SDLLogManager logWithLevel:SDLLogLevelVerbose fileName:SDLLOG_FILE functionName:SDLLOG_FUNC line:__LINE__ message:msg, ##__VA_ARGS__];
+#define SDLLogD(msg, ...) [SDLLogManager logWithLevel:SDLLogLevelDebug fileName:SDLLOG_FILE functionName:SDLLOG_FUNC line:__LINE__ message:msg, ##__VA_ARGS__];
+
+#else
+
+#define SDLLogV(msg, ...)
+#define SDLLogD(msg, ...)
+
+#endif
+
+
+#pragma mark Release Logs
+
+#define SDLLogW(msg, ...) [SDLLogManager logWithLevel:SDLLogLevelWarning fileName:SDLLOG_FILE functionName:SDLLOG_FUNC line:__LINE__ message:msg, ##__VA_ARGS__];
+#define SDLLogE(msg, ...) [SDLLogManager logWithLevel:SDLLogLevelError fileName:SDLLOG_FILE functionName:SDLLOG_FUNC line:__LINE__ message:msg, ##__VA_ARGS__];