marsevilspirit commented on PR #2832:
URL: https://github.com/apache/dubbo-go/pull/2832#issuecomment-2801979692

   > ```go
   > package main
   > 
   > import (
   >    "context"
   >    "time"
   > 
   >    "dubbo.apache.org/dubbo-go/v3"
   >    "dubbo.apache.org/dubbo-go/v3/protocol"
   > 
   >    _ "dubbo.apache.org/dubbo-go/v3/imports"
   >    glog "github.com/dubbogo/gost/log/logger"
   > 
   >    "dubbo.apache.org/dubbo-go/v3/logger"
   > )
   > 
   > func main() {
   >    ins, err := dubbo.NewInstance(
   >            dubbo.WithProtocol(
   >                    protocol.WithTriple(),
   >                    protocol.WithPort(20000),
   >            ),
   >            dubbo.WithLogger(
   >                    logger.WithLevel("info"),
   >                    logger.WithZap(),
   >            ),
   >    )
   >    // some logic
   >    logger.SetLoggerLevel("debug")
   > 
   >    if err != nil {
   >            panic(err)
   >    }
   >    server, err := ins.NewServer()
   >    if err != nil {
   >            panic(err)
   >    }
   >    go server.Serve()
   >    ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
   >    defer cancel()
   >    for {
   >            select {
   >            case <-ctx.Done():
   >                    return
   >            default:
   >                    glog.Info("hello dubbogo this is info log")
   >                    glog.Debug("hello dubbogo this is debug log")
   >                    glog.Warn("hello dubbogo this is warn log")
   >                    time.Sleep(time.Second * 1)
   >            }
   >    }
   > }
   > ```
   > 
   > Here is the sample code. From my perspective, the `logger` is better to be 
`dubbo.apache.org/dubbo-go/v3/logger` instead of 
`github.com/dubbogo/gost/log/logger`. (ambiguity with same name)以下是示例代码。在我看来,` 
记录器`最好是 `dubbo.apache.org/dubbo-go/v3/logger` ,而不是 
`github.com/dubbogo/gost/log/logger` 。
   > 
   > `gost` is a stable (or stale) sdk which has not been updated for 2 years, 
so this PR is trying to limit the modification in `dubbo-go`, avoiding updating 
`github.com/dubbogo/gost/log/logger`.`gost` 是一个稳定(或陈旧)的 sdk,已有两年未更新,因此本 PR 试图限制 
`dubbo-go` 中的修改,避免更新 `github.com/dubbogo/gost/log/logger` 。
   
   sounds good.
   Let's develop an entirely new logger for dubbo-go.


-- 
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: notifications-unsubscr...@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to