You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/15 12:40:01 UTC

[GitHub] [beam] AydarZaynutdinov commented on a change in pull request #16241: [BEAM-13440] [Playground] Implement initialization of Cloud Logger

AydarZaynutdinov commented on a change in pull request #16241:
URL: https://github.com/apache/beam/pull/16241#discussion_r769584532



##########
File path: playground/backend/internal/logger/logger.go
##########
@@ -32,6 +34,25 @@ const (
 
 var handlers []Handler
 
+// SetupLogger constructs logger by application environment
+// Add handlers in root logger:
+//   CloudLoggingHandler - for logs to the Cloud Logging service if server running on App Engine
+//   StdHandler - for logs to the stderr/stdout if server running locally
+func SetupLogger(ctx context.Context, appEnv environment.ApplicationEnvs) {

Review comment:
       ```suggestion
   func SetupLogger(ctx context.Context, launchSite, googleProjectId string) {
   ```

##########
File path: playground/backend/internal/logger/std_handler.go
##########
@@ -0,0 +1,77 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You 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.
+
+package logger
+
+import (
+	"fmt"
+	"log"
+)
+
+type StdHandler struct {

Review comment:
       Is this handler used only to log messages using standard `log`? If yes I suggest adding some comments (or maybe renaming) about that so this point will be more understandable.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org