Skip to content

Commit

Permalink
Add logging of all NSNotification events
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Oct 9, 2024
1 parent 4447eb1 commit a67bb37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Monal/Classes/HelperTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ void swizzle(Class c, SEL orig, SEL new)
method_exchangeImplementations(origMethod, newMethod);
}

static void notification_center_logging(CFNotificationCenterRef center, void* observer, CFStringRef name, const void* object, CFDictionaryRef userInfo)
{
DDLogDebug(@"NSNotification %@ with %@: %@", name, object, userInfo);
}

@implementation WeakContainer
-(id) initWithObj:(id) obj
{
Expand Down Expand Up @@ -516,6 +521,14 @@ +(void) initSystem

[SwiftHelpers initSwiftHelpers];
[self activityLog];

//see https://stackoverflow.com/a/3738387
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(),
NULL,
notification_center_logging,
NULL,
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
}

+(void) configureDefaultAudioSession
Expand Down

0 comments on commit a67bb37

Please sign in to comment.