Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Dec 31, 2024
1 parent 7821c20 commit 70e0ee2
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Monal/Classes/MLUDPLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ +(void) directlyWriteLogMessage:(DDLogMessage*) logMessage
[[self class] logError:@"Ignoring call to directlySyncWriteLogMessage: _self still nil!"];
return;
}
return [_self realLogMessage:logMessage wasDirect:YES];
return [_self realLogMessage:logMessage isDirect:YES];
}

-(void) dealloc
Expand Down Expand Up @@ -244,10 +244,10 @@ -(void) createConnectionIfNeeded

-(void) logMessage:(DDLogMessage*) logMessage
{
return [self realLogMessage:logMessage wasDirect:NO];
return [self realLogMessage:logMessage isDirect:NO];
}

-(void) realLogMessage:(DDLogMessage*) logMessage wasDirect:(BOOL) direct
-(void) realLogMessage:(DDLogMessage*) logMessage isDirect:(BOOL) direct
{
static uint64_t counter = 0;

Expand All @@ -259,6 +259,22 @@ -(void) realLogMessage:(DDLogMessage*) logMessage wasDirect:(BOOL) direct
if(!direct && logMessage.ml_isDirect)
return;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
logMessage = [[DDLogMessage alloc]
initWithFormat:logMessage.messageFormat
formatted:[NSString stringWithFormat:@"direct=%@, logMessage.ml_isDirect=%@ ~~~ %@", bool2str(direct), bool2str(logMessage.ml_isDirect), logMessage.message]
level:logMessage.level
flag:logMessage.flag
context:logMessage.context
file:logMessage.file
function:logMessage.function
line:logMessage.line
tag:logMessage.tag
options:logMessage.options
timestamp:logMessage.timestamp];
#pragma clang diagnostic pop

NSError* error = nil;
NSData* rawData = [HelperTools convertLogmessageToJsonData:logMessage counter:&counter andError:&error];
if(error != nil || rawData == nil)
Expand Down

0 comments on commit 70e0ee2

Please sign in to comment.