You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/05 07:11:34 UTC

[GitHub] [incubator-devlake] keon94 commented on a diff in pull request #2656: [feat-2578]: Download pipeline logging archives API

keon94 commented on code in PR #2656:
URL: https://github.com/apache/incubator-devlake/pull/2656#discussion_r938511921


##########
logger/logger.go:
##########
@@ -75,32 +95,84 @@ func (l *DefaultLogger) Error(format string, a ...interface{}) {
 	l.Log(core.LOG_ERROR, format, a...)
 }
 
-// bind two writer to logger
-func (l *DefaultLogger) Nested(name string) core.Logger {
-	writerStd := os.Stdout
-	fileName := ""
-	loggerPrefixRegex := regexp.MustCompile(`(\[task #\d+]\s\[\w+])`)
-	groups := loggerPrefixRegex.FindStringSubmatch(fmt.Sprintf("%s [%s]", l.prefix, name))
-	if len(groups) > 1 {
-		fileName = groups[1]
+func (l *DefaultLogger) Nested(newPrefix string, config ...*core.LoggerConfig) core.Logger {

Review Comment:
   I am personally not a fan of this method signature, but wanted to do it without having to change any of the existing Nested(str) calls (for now anyway).
   It makes more sense to just have Prefix also be a field inside LoggerConfig and make this function just take in a LoggerConfig instance. Maybe rename this from Nested to something else too



-- 
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: commits-unsubscribe@devlake.apache.org

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