aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c
diff options
context:
space:
mode:
Diffstat (limited to 'src/objective-c')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+MobileLog.h30
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+MobileLog.m33
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.h1
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m7
4 files changed, 4 insertions, 67 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall+MobileLog.h b/src/objective-c/GRPCClient/GRPCCall+MobileLog.h
deleted file mode 100644
index 53b347d9ca..0000000000
--- a/src/objective-c/GRPCClient/GRPCCall+MobileLog.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#import "GRPCCall.h"
-
-@interface GRPCCall (MobileLog)
-// Set the object to be passed down along channel stack with channel arg
-// GRPC_ARG_MOBILE_LOG_CONFIG. The setting may be used by custom channel
-// filters for metrics logging.
-+ (void)setLogConfig:(id)logConfig;
-
-// Obtain the object to be passed down along channel stack with channel arg
-// GRPC_ARG_MOBILE_LOG_CONFIG.
-+ (id)logConfig;
-@end
diff --git a/src/objective-c/GRPCClient/GRPCCall+MobileLog.m b/src/objective-c/GRPCClient/GRPCCall+MobileLog.m
deleted file mode 100644
index 4dedb7de8b..0000000000
--- a/src/objective-c/GRPCClient/GRPCCall+MobileLog.m
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#import "GRPCCall+MobileLog.h"
-
-static id globalLogConfig = nil;
-
-@implementation GRPCCall (MobileLog)
-
-+ (void)setLogConfig:(id)logConfig {
- globalLogConfig = logConfig;
-}
-
-+ (id)logConfig {
- return globalLogConfig;
-}
-
-@end
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.h b/src/objective-c/GRPCClient/private/GRPCHost.h
index 6697f61be4..d9916d9303 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.h
+++ b/src/objective-c/GRPCClient/private/GRPCHost.h
@@ -37,6 +37,7 @@ struct grpc_channel_credentials;
@property(nonatomic) grpc_compression_algorithm compressAlgorithm;
@property(nonatomic) int keepaliveInterval;
@property(nonatomic) int keepaliveTimeout;
+@property(nonatomic) id logContext;
/** The following properties should only be modified for testing: */
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index c3ea9afc37..bd5fd94118 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -18,7 +18,6 @@
#import "GRPCHost.h"
-#import <GRPCClient/GRPCCall+MobileLog.h>
#import <GRPCClient/GRPCCall.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@@ -223,9 +222,9 @@ static NSMutableDictionary *kHostCache;
args[@GRPC_ARG_KEEPALIVE_TIMEOUT_MS] = [NSNumber numberWithInt:_keepaliveTimeout];
}
- id logConfig = [GRPCCall logConfig];
- if (logConfig != nil) {
- args[@GRPC_ARG_MOBILE_LOG_CONFIG] = logConfig;
+ id logContext = self.logContext;
+ if (logContext != nil) {
+ args[@GRPC_ARG_MOBILE_LOG_CONTEXT] = logContext;
}
if (useCronet) {