mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-24 11:56:18 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
39 lines
1023 B
Objective-C
39 lines
1023 B
Objective-C
#import <NetworkLogging/NetworkLogging.h>
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <MtProtoKit/MTLogging.h>
|
|
|
|
static void (*bridgingTrace)(NSString *, NSString *);
|
|
void setBridgingTraceFunction(void (*f)(NSString *, NSString *)) {
|
|
bridgingTrace = f;
|
|
}
|
|
|
|
static void (*bridgingShortTrace)(NSString *, NSString *);
|
|
void setBridgingShortTraceFunction(void (*f)(NSString *, NSString *)) {
|
|
bridgingShortTrace = f;
|
|
}
|
|
|
|
static void TGTelegramLoggingFunction(NSString *format) {
|
|
if (bridgingTrace) {
|
|
bridgingTrace(@"MT", format);
|
|
}
|
|
}
|
|
|
|
static void TGTelegramShortLoggingFunction(NSString *format) {
|
|
if (bridgingShortTrace) {
|
|
bridgingShortTrace(@"MT", format);
|
|
}
|
|
}
|
|
|
|
void NetworkRegisterLoggingFunction() {
|
|
static dispatch_once_t onceToken;
|
|
dispatch_once(&onceToken, ^{
|
|
MTLogSetLoggingFunction(&TGTelegramLoggingFunction);
|
|
MTLogSetShortLoggingFunction(&TGTelegramShortLoggingFunction);
|
|
});
|
|
}
|
|
|
|
void NetworkSetLoggingEnabled(bool value) {
|
|
MTLogSetEnabled(value);
|
|
}
|