1 /* 2 * Copyright 2018, gRPC Authors All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package io.grpc.services; 18 19 import io.grpc.BinaryLog; 20 import io.grpc.ExperimentalApi; 21 import io.grpc.protobuf.services.BinaryLogSink; 22 import java.io.IOException; 23 24 /** 25 * Utility class to create BinaryLog instances. 26 * 27 * @deprecated Use {@link io.grpc.protobuf.services.BinaryLogs} instead. 28 */ 29 @Deprecated 30 @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4017") 31 public final class BinaryLogs { 32 /** 33 * Creates a binary log that writes to a temp file. <b>Warning:</b> this implementation is 34 * not performance optimized, and RPCs will experience back pressure if disk IO does not keep 35 * up. 36 */ createBinaryLog()37 public static BinaryLog createBinaryLog() throws IOException { 38 return io.grpc.protobuf.services.BinaryLogs.createBinaryLog(); 39 } 40 41 /** 42 * Deprecated and will be removed in a future version of gRPC. 43 */ 44 @Deprecated createBinaryLog(BinaryLogSink sink)45 public static BinaryLog createBinaryLog(BinaryLogSink sink) throws IOException { 46 return io.grpc.protobuf.services.BinaryLogs.createBinaryLog(sink); 47 } 48 49 /** 50 * Creates a binary log with a custom {@link BinaryLogSink} for receiving the logged data, 51 * and a config string as defined by 52 * <a href="https://github.com/grpc/proposal/blob/master/A16-binary-logging.md"> 53 * A16-binary-logging</a>. 54 */ createBinaryLog(BinaryLogSink sink, String configStr)55 public static BinaryLog createBinaryLog(BinaryLogSink sink, String configStr) throws IOException { 56 return io.grpc.protobuf.services.BinaryLogs.createBinaryLog(sink, configStr); 57 } 58 BinaryLogs()59 private BinaryLogs() {} 60 } 61