Skip to content

Commit

Permalink
Update local logging implemenration.
Browse files Browse the repository at this point in the history
  • Loading branch information
shinfan committed Jun 9, 2016
1 parent 53c0f24 commit 2c9b46e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
32 changes: 32 additions & 0 deletions gcloud-java-logging/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="generated/src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse;
import com.google.logging.v2.LogEntry;
import com.google.logging.v2.LoggingServiceV2Grpc;
import com.google.logging.v2.ReadLogEntriesRequest;
import com.google.logging.v2.ReadLogEntriesResponse;
import com.google.logging.v2.WriteLogEntriesRequest;
import com.google.logging.v2.WriteLogEntriesResponse;
import com.google.protobuf.ByteString;
Expand Down Expand Up @@ -77,22 +75,6 @@ public void listLogEntries(
responseObserver.onCompleted();
}

@Override
public void readLogEntries(
ReadLogEntriesRequest request, StreamObserver<ReadLogEntriesResponse> responseObserver) {
List<LogEntry> entries = new ArrayList<>();
for (ByteString proj : request.getProjectIdsList().asByteStringList()) {
String prefix = "projects/" + proj.toStringUtf8() + "/";
for (Map.Entry<String, List<LogEntry>> entry : logs.entrySet()) {
if (entry.getKey().startsWith(prefix)) {
entries.addAll(entry.getValue());
}
}
}
responseObserver.onNext(ReadLogEntriesResponse.newBuilder().addAllEntries(entries).build());
responseObserver.onCompleted();
}

@Override
public void listMonitoredResourceDescriptors(
ListMonitoredResourceDescriptorsRequest request,
Expand Down

0 comments on commit 2c9b46e

Please sign in to comment.