Skip to content

Commit

Permalink
Add logDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
twometresteve committed Nov 3, 2023
1 parent 802ffb1 commit e7843e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions features/fixtures/shared/scenarios/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import <Foundation/Foundation.h>

void logDebugObjC(NSString *format, ...);
void logInfoObjC(NSString *format, ...);
void logWarnObjC(NSString *format, ...);
void logErrorObjC(NSString *format, ...);
Expand All @@ -16,6 +17,7 @@ void logErrorObjC(NSString *format, ...);
//#define logWarn(FMT, ...) logWarnObjC(FMT, __VA_ARGS__)
//#define logError(FMT, ...) logErrorObjC(FMT, __VA_ARGS__)

#define logDebug logDebugObjC
#define logInfo logInfoObjC
#define logWarn logWarnObjC
#define logError logErrorObjC
7 changes: 7 additions & 0 deletions features/fixtures/shared/scenarios/Logging.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ void logInternal(const char* level, NSString *format, va_list args) {

}

void logDebugObjC(NSString *format, ...) {
va_list args;
va_start(args, format);
logInternal("debug", format, args);
va_end(args);
}

void logInfoObjC(NSString *format, ...) {
va_list args;
va_start(args, format);
Expand Down
9 changes: 9 additions & 0 deletions features/fixtures/shared/utils/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

import Foundation

//public func logDebug(_ format: String) {
// logDebug(format: format, args: 0 as Int)
//}
public func logDebug(_ format: String, _ args: CVarArg...) {
withVaList(args) {
logInternal("debug", format, $0)
}
}

//public func logInfo(_ format: String) {
// logInfo(format: format, args: 0 as Int)
//}
Expand Down

0 comments on commit e7843e7

Please sign in to comment.