public class LogdClient extends Object implements LogDaemonClient
| Constructor and Description |
|---|
LogdClient(io.grpc.ManagedChannelBuilder<?> channelBuilder,
StreamObserverFactory streamObserverFactory)
Constructs a LogdClient with the provided channel
|
LogdClient(String host,
int port)
Constructs a LogdClient with the provided hostname and port number.
|
LogdClient(String host,
int port,
StreamObserverFactory streamObserverFactory)
Constructs a LogdClient with the provided hostname, port number and an implementation of
StreamObserverFactory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
createLogFile(String path,
com.facebook.buck.logd.proto.LogType logType)
Client calls this method to request LogD to create a log file in file-system and/or storage.
|
io.grpc.stub.StreamObserver<com.facebook.buck.logd.proto.LogMessage> |
openLog(int logFileId,
String logContent)
Client calls this method to acquire a StreamObserver object which listens for incoming logs.
|
void |
shutdown()
close all existing channels to logD server
|
public LogdClient(String host, int port)
host - host nameport - port numberpublic LogdClient(String host, int port, StreamObserverFactory streamObserverFactory)
host - host nameport - port numberstreamObserverFactory - an implementation of StreamObserverFactorypublic LogdClient(io.grpc.ManagedChannelBuilder<?> channelBuilder,
StreamObserverFactory streamObserverFactory)
channelBuilder - a channel to LogD serverpublic void shutdown()
LogDaemonClientshutdown in interface LogDaemonClientpublic int createLogFile(String path, com.facebook.buck.logd.proto.LogType logType) throws LogDaemonException
LogDaemonClientcreateLogFile in interface LogDaemonClientlogFileId corresponding to the created file by LogD serverLogDaemonExceptionpublic io.grpc.stub.StreamObserver<com.facebook.buck.logd.proto.LogMessage> openLog(int logFileId,
String logContent)
throws LogDaemonException
LogDaemonClientlogFileIdopenLog in interface LogDaemonClientlogFileId - log file identifier generated by LogD serverlogContent - log message to be streamed to LogDLogDaemonException