XiaoYou201 commented on code in PR #10040:
URL: https://github.com/apache/inlong/pull/10040#discussion_r1574544028


##########
inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/config.go:
##########
@@ -39,3 +44,40 @@ var defaultConfig = &OutputConfig{
        MaxAge:     3,
        Level:      "warn",
 }
+
+// SetLogLevel set log level
+func SetLogLevel(level string) error {
+       if _, exist := LevelNames[level]; !exist {
+               return errors.New("the supported log levels are: trace, debug, 
info, warn, error, fatal. Please check your log level")
+       }
+       defaultConfig.Level = level
+       return nil
+}
+
+// SetLogPath set log path
+func SetLogPath(path string) error {
+       err := isValidLogPath(path)
+       if err != nil {
+               return err
+       }
+       defaultConfig.LogPath = path
+       return nil
+}
+func isValidLogPath(path string) error {

Review Comment:
   Thanks suggestion, fixed it.



##########
inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/config.go:
##########
@@ -39,3 +44,40 @@ var defaultConfig = &OutputConfig{
        MaxAge:     3,
        Level:      "warn",
 }
+
+// SetLogLevel set log level
+func SetLogLevel(level string) error {
+       if _, exist := LevelNames[level]; !exist {
+               return errors.New("the supported log levels are: trace, debug, 
info, warn, error, fatal. Please check your log level")
+       }
+       defaultConfig.Level = level
+       return nil
+}
+
+// SetLogPath set log path
+func SetLogPath(path string) error {
+       err := isValidLogPath(path)
+       if err != nil {
+               return err
+       }
+       defaultConfig.LogPath = path
+       return nil
+}
+func isValidLogPath(path string) error {

Review Comment:
   Thanks suggestion, fixed it.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to