chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gavincornw...@apache.org
Subject svn commit: r1447948 - /chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h
Date Tue, 19 Feb 2013 22:44:30 GMT
Author: gavincornwell
Date: Tue Feb 19 22:44:30 2013
New Revision: 1447948

URL: http://svn.apache.org/r1447948
Log:
Proposed header file for CMISLog utility (not added to XCode project yet)

Added:
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h   (with props)

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h?rev=1447948&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h Tue Feb 19 22:44:30 2013
@@ -0,0 +1,83 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+/**
+ * Convenience macros
+ */
+#define CMISLogError(...)   [[CMISLog sharedInstance] logError:__VA_ARGS__]
+#define CMISLogWarning(...) [[CMISLog sharedInstance] logWarning:__VA_ARGS__]
+#define CMISLogInfo(...)    [[CMISLog sharedInstance] logInfo:__VA_ARGS__]
+#define CMISLogDebug(...)   [[CMISLog sharedInstance] logDebug:__VA_ARGS__]
+#define CMISLogTrace(...)   [[CMISLog sharedInstance] logTrace:__VA_ARGS__]
+
+/**
+ * Default logging level
+ *
+ * The default logging level is Info for release builds and Debug for debug builds.
+ * The recommended way to override the default is to #include this header file in your app's
.pch file
+ * and then redefine the CMIS_LOG_LEVEL macro to suit, e.g.
+ *     #undef CMIS_LOG_LEVEL
+ *     #define CMIS_LOG_LEVEL CMISLogLevelTrace
+ */
+#if !defined(CMIS_LOG_LEVEL)
+    #if DEBUG
+        #define CMIS_LOG_LEVEL CMISLogLevelDebug
+    #else
+        #define CMIS_LOG_LEVEL CMISLogLevelInfo
+    #endif
+#endif
+
+#import <Foundation/Foundation.h>
+
+
+@interface CMISLog : NSObject
+
+typedef NS_ENUM(NSUInteger, CMISLogLevel)
+{
+    CMISLogLevelOff = 0,
+    CMISLogLevelError,
+    CMISLogLevelWarning,
+    CMISLogLevelInfo,
+    CMISLogLevelDebug,
+    CMISLogLevelTrace
+};
+
+@property (nonatomic, assign) CMISLogLevel logLevel;
+
+/**
+ * Returns the shared singleton
+ */
++ (CMISLog *)sharedInstance;
+
+/**
+ * Designated initializer. Can be used when not instantiating this class in singleton mode.
+ */
+- (id)initWithLogLevel:(CMISLogLevel)logLevel;
+
+- (NSString *)stringForLogLevel:(CMISLogLevel)logLevel;
+
+- (void)logErrorFromError:(NSError *)error;
+
+- (void)logError:(NSString *)format, ...;
+
+- (void)logWarning:(NSString *)format, ...;
+
+- (void)logInfo:(NSString *)format, ...;
+
+- (void)logDebug:(NSString *)format, ...;
+
+- (void)logTrace:(NSString *)format, ...;
+
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISLog.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message