Refact:delete and optimize code

This commit is contained in:
pengfeizhou
2021-02-23 17:24:02 +08:00
committed by osborn
parent 2f7762e670
commit 04c19992ad
8 changed files with 149 additions and 32 deletions

View File

@@ -30,11 +30,11 @@ - (void)onException:(NSException *)exception inContext:(DoricContext *)context {
if (!DoricDev.instance.isInDevMode) {
return;
}
[DoricDev.instance.wsClient sendToServer:@"EXCEPTION"
payload:@{
@"source": [context.source stringByReplacingOccurrencesOfString:@".js" withString:@".ts"],
@"exception": exception.reason
}];
[DoricDev.instance sendDevCommand:@"EXCEPTION"
payload:@{
@"source": [context.source stringByReplacingOccurrencesOfString:@".js" withString:@".ts"],
@"exception": exception.reason
}];
}
- (void)onLog:(DoricLogType)type message:(NSString *)message {
@@ -48,10 +48,10 @@ - (void)onLog:(DoricLogType)type message:(NSString *)message {
typeString = @"ERROR";
}
[DoricDev.instance.wsClient sendToServer:@"LOG"
payload:@{
@"type": typeString,
@"message": message
}];
[DoricDev.instance sendDevCommand:@"LOG"
payload:@{
@"type": typeString,
@"message": message
}];
}
@end