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 like 
this so I wouldn't have to change any of the existing Nested(str) calls (for 
now anyway).
   But 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: [email protected]

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

Reply via email to