Skip to content

Commit

Permalink
Replace GULLoggerService with NSString *
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard committed Jul 10, 2024
1 parent 150743c commit ed612a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 9 additions & 9 deletions GoogleUtilities/Logger/GULLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ os_log_type_t GULLoggerLevelToOSLogType(GULLoggerLevel level) {

void GULOSLogBasic(GULLoggerLevel level,
NSString *subsystem,
GULLoggerService category,
NSString *category,
BOOL forceLog,
NSString *messageCode,
NSString *message,
Expand Down Expand Up @@ -222,14 +222,14 @@ void GULLogBasic(GULLoggerLevel level,
* Calling GULLogDebug({service}, @"I-XYZ000001", @"Configure succeed.") shows:
* yyyy-mm-dd hh:mm:ss.SSS sender[PID] <Debug> [{service}][I-XYZ000001] Configure succeed.
*/
#define GUL_LOGGING_FUNCTION(level) \
void GULOSLog##level(NSString *subsystem, GULLoggerService category, BOOL force, \
NSString *messageCode, NSString *message, ...) { \
va_list args_ptr; \
va_start(args_ptr, message); \
GULOSLogBasic(GULLoggerLevel##level, subsystem, category, force, messageCode, message, \
args_ptr); \
va_end(args_ptr); \
#define GUL_LOGGING_FUNCTION(level) \
void GULOSLog##level(NSString *subsystem, NSString *category, BOOL force, NSString *messageCode, \
NSString *message, ...) { \
va_list args_ptr; \
va_start(args_ptr, message); \
GULOSLogBasic(GULLoggerLevel##level, subsystem, category, force, messageCode, message, \
args_ptr); \
va_end(args_ptr); \
}

GUL_LOGGING_FUNCTION(Error)
Expand Down
6 changes: 4 additions & 2 deletions GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN

/**
* The services used in the logger.
*
* DEPRECATED; use NSString instead.
*/
typedef NSString *const GULLoggerService;

Expand Down Expand Up @@ -87,7 +89,7 @@ extern void GULLoggerRegisterVersion(NSString *version);
*/
extern void GULOSLogBasic(GULLoggerLevel level,
NSString *subsystem,
GULLoggerService category,
NSString *category,
BOOL forceLog,
NSString *messageCode,
NSString *message,
Expand Down Expand Up @@ -225,7 +227,7 @@ extern void GULOSLogDebug(NSString *subsystem,
/// a format string; optional if `message` is not a format string.
+ (void)logWithLevel:(GULLoggerLevel)level
subsystem:(NSString *)subsystem
category:(GULLoggerService)category
category:(NSString *)category
messageCode:(NSString *)messageCode
message:(NSString *)message
arguments:(va_list)args;
Expand Down

0 comments on commit ed612a5

Please sign in to comment.