This commit is contained in:
Pierre-Olivier Latour 2014-11-28 16:21:01 +09:00
parent 18889793b7
commit d2001e38ca
3 changed files with 21 additions and 13 deletions

View File

@ -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;

View File

@ -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
}

View File

@ -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;