Pierre-Olivier Latour 10 rokov pred
rodič
commit
d2001e38ca

+ 8 - 0
GCDWebServer/Core/GCDWebServer.h

@@ -523,6 +523,14 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
  *
  *  @warning The interpretation of the "level" argument depends on the logging
  *  facility used at compile time.
+ *
+ *  If using the built-in logging facility, the log levels are as follow:
+ *  DEBUG = 0
+ *  VERBOSE = 1
+ *  INFO = 2
+ *  WARNING = 3
+ *  ERROR = 4
+ *  EXCEPTION = 5
  */
 + (void)setLogLevel:(int)level;
 

+ 1 - 1
GCDWebServer/Core/GCDWebServer.m

@@ -986,7 +986,7 @@ static inline NSString* _EncodeBase64(NSString* string) {
   [XLSharedFacility setMinLogLevel:level];
 #elif defined(__GCDWEBSERVER_LOGGING_FACILITY_COCOALUMBERJACK__)
   GCDWebServerLogLevel = level;
-#else
+#elif defined(__GCDWEBSERVER_LOGGING_FACILITY_BUILTIN__)
   GCDWebServerLogLevel = level;
 #endif
 }

+ 12 - 12
GCDWebServer/Core/GCDWebServerPrivate.h

@@ -48,12 +48,22 @@
 #import "GCDWebServerFileResponse.h"
 #import "GCDWebServerStreamedResponse.h"
 
+/**
+ *  Check if a custom logging facility should be used instead.
+ */
+
+#if defined(__GCDWEBSERVER_LOGGING_HEADER__)
+
+#define __GCDWEBSERVER_LOGGING_FACILITY_CUSTOM__
+
+#import __GCDWEBSERVER_LOGGING_HEADER__
+
 /**
  *  Automatically detect if XLFacility is available and if so use it as a
  *  logging facility.
  */
 
-#if defined(__has_include) && __has_include("XLFacilityMacros.h")
+#elif defined(__has_include) && __has_include("XLFacilityMacros.h")
 
 #define __GCDWEBSERVER_LOGGING_FACILITY_XLFACILITY__
 
@@ -94,16 +104,6 @@ extern int GCDWebServerLogLevel;
 #define GWS_LOG_ERROR(...) DDLogError(__VA_ARGS__)
 #define GWS_LOG_EXCEPTION(__EXCEPTION__) DDLogError(@"%@", __EXCEPTION__)
 
-/**
- *  Check if a custom logging facility should be used instead.
- */
-
-#elif defined(__GCDWEBSERVER_LOGGING_HEADER__)
-
-#define __GCDWEBSERVER_LOGGING_FACILITY_CUSTOM__
-
-#import __GCDWEBSERVER_LOGGING_HEADER__
-
 /**
  *  If all of the above fail, then use GCDWebServer built-in
  *  logging facility.
@@ -119,7 +119,7 @@ typedef NS_ENUM(int, GCDWebServerLoggingLevel) {
   kGCDWebServerLoggingLevel_Info,
   kGCDWebServerLoggingLevel_Warning,
   kGCDWebServerLoggingLevel_Error,
-  kGCDWebServerLoggingLevel_Exception,
+  kGCDWebServerLoggingLevel_Exception
 };
 
 extern GCDWebServerLoggingLevel GCDWebServerLogLevel;