Skip to content

Commit

Permalink
functions/logging: add stdout/stderr + ignored logs severity note (#2422
Browse files Browse the repository at this point in the history
)

~@vinod-at-google @labtopia IIRC the lack of log severity info is a known issue. (If it's not, let me know so I can hold off on merging this PR.)~
  • Loading branch information
Ace Nassri authored Mar 21, 2020
1 parent 1e5e99a commit 550f349
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class LogHelloWorld implements HttpFunction {
@Override
public void service(HttpRequest request, HttpResponse response)
throws IOException {
System.out.println("I am a log to stdout!");
System.err.println("I am a log to stderr!");

// Stackdriver does not detect severity from Cloud Functions log output
LOGGER.info("I am an info log!");
LOGGER.warning("I am a warning log!");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void beforeTest() throws IOException {

@After
public void afterTest() {
System.setOut(null);
System.out.flush();
logHandler.flush();
}

Expand Down

0 comments on commit 550f349

Please sign in to comment.