WIP : Elektron Logging library #16
|
@ -20,33 +20,37 @@ func NewClsfnTaskDistrOverheadLogger(logType int, prefix string) *ClsfnTaskDistr
|
|||
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
|
||||
func (cLog ClsfnTaskDistrOverheadLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if cLog.Type == logType {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if config.TaskDistrConfig.Enabled {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if cLog.Type == logType {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
|
||||
logger.SetLevel(level)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.SetLevel(level)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
|
||||
if cLog.AllowOnConsole {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if cLog.AllowOnConsole {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.SetOutput(cLog.LogFile)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.SetOutput(cLog.LogFile)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if cLog.next != nil {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.next.Log(logType, level, logData, message)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if cLog.next != nil {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.next.Log(logType, level, logData, message)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
}
|
||||
|
||||
func (cLog *ClsfnTaskDistrOverheadLogger) CreateLogFile(prefix string) {
|
||||
|
||||
filename := strings.Join([]string{prefix, config.TaskDistrConfig.FilenameExtension}, "")
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
dirName := logDir.getDirName()
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if dirName != "" {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
} else {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.LogFile = logFile
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.AllowOnConsole = config.TaskDistrConfig.AllowOnConsole
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if config.TaskDistrConfig.Enabled {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
filename := strings.Join([]string{prefix, config.TaskDistrConfig.FilenameExtension}, "")
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
dirName := logDir.getDirName()
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if dirName != "" {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
} else {
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.LogFile = logFile
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
cLog.AllowOnConsole = config.TaskDistrConfig.AllowOnConsole
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|||
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
![]() Use struct literals instead of new as it's more descriptive: Use struct literals instead of new as it's more descriptive:
`&ClsfnTaskDistOverheadLogger{}`
![]() Where is log dir coming from? Shouldn't be a global Where is log dir coming from? Shouldn't be a global
![]() Okay, will do the changes Okay, will do the changes
![]() It is defined in It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
![]() I think it will be better if it is encapsulated.
I think it will be better if it is encapsulated.
Something like
```go
type logDir struct {
name string
// other fields if necessary.
}
```
![]() Maybe refactor to Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
![]() You should use filepath.Join(...) to keep it generic. You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
![]() You can possible rewrite this function to something like the one shown below.
You can possible rewrite this function to something like the one shown below.
```go
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
filename := prefix + config.TaskDistConfig.FilenameExtension
if logDir != "" {
if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
}
}
}
```
![]() Done Done
![]() Done Done
![]() Okay. Sure Okay. Sure
![]() Done Done
![]() looks good now thanks! looks good now thanks!
|
|
@ -19,31 +19,35 @@ func NewConsoleLogger(logType int, prefix string) *ConsoleLogger {
|
|||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
return cLog
|
||||
}
|
||||
func (cLog ConsoleLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if logType <= cLog.Type {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if config.ConsoleConfig.Enabled {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if logType <= cLog.Type {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
|
||||
logger.SetLevel(level)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.SetLevel(level)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
|
||||
logger.SetOutput(cLog.LogFile)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if cLog.next != nil {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.next.Log(logType, level, logData, message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.SetOutput(cLog.LogFile)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if cLog.next != nil {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.next.Log(logType, level, logData, message)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
}
|
||||
|
||||
func (cLog *ConsoleLogger) CreateLogFile(prefix string) {
|
||||
|
||||
filename := strings.Join([]string{prefix, config.ConsoleConfig.FilenameExtension}, "")
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
dirName := logDir.getDirName()
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if dirName != "" {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
} else {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.LogFile = logFile
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if config.ConsoleConfig.Enabled {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
filename := strings.Join([]string{prefix, config.ConsoleConfig.FilenameExtension}, "")
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
dirName := logDir.getDirName()
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if dirName != "" {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
} else {
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.LogFile = logFile
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|||
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
![]() I see why you are directly assigning I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
![]() Why the pointer receiver? Technically, this function should not lead to change of state. Why the pointer receiver? Technically, this function should not lead to change of state.
![]() Sure Sure
![]() Yeah, thats right. I will change it Yeah, thats right. I will change it
|
|
@ -20,33 +20,36 @@ func NewPCPLogger(logType int, prefix string) *PCPLogger {
|
|||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
|
||||
func (pLog PCPLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if pLog.Type == logType {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if config.PCPConfig.Enabled {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if pLog.Type == logType {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
|
||||
logger.SetLevel(level)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.SetLevel(level)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
|
||||
if pLog.AllowOnConsole {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if pLog.AllowOnConsole {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.SetOutput(os.Stdout)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.SetOutput(pLog.LogFile)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.SetOutput(pLog.LogFile)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
logger.WithFields(logData).Println(message)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if pLog.next != nil {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.next.Log(logType, level, logData, message)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if pLog.next != nil {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.next.Log(logType, level, logData, message)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
}
|
||||
|
||||
func (pLog *PCPLogger) CreateLogFile(prefix string) {
|
||||
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
filename := strings.Join([]string{prefix, config.PCPConfig.FilenameExtension}, "")
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
dirName := logDir.getDirName()
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if dirName != "" {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
} else {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.LogFile = logFile
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.AllowOnConsole = config.PCPConfig.AllowOnConsole
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if config.PCPConfig.Enabled {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
filename := strings.Join([]string{prefix, config.PCPConfig.FilenameExtension}, "")
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
dirName := logDir.getDirName()
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if dirName != "" {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
} else {
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.LogFile = logFile
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
pLog.AllowOnConsole = config.PCPConfig.AllowOnConsole
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|||
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
![]() Refactor to Refactor to `PCPLogger`.
![]() Why not just do this?
Where Why not just do this?
```go
return &PCPLogger{
LoggerIml{
Type: logType
LogFile: CreateLogFile(prefix),
}
}
```
Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
![]() Done Done
|
|
@ -20,33 +20,36 @@ func NewSchedPolicySwitchLogger(logType int, prefix string) *SchedPolicySwitchLo
|
|||
}
|
||||
|
||||
func (sLog SchedPolicySwitchLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if sLog.Type == logType {
|
||||
if config.SPSConfig.Enabled {
|
||||
if sLog.Type == logType {
|
||||
|
||||
logger.SetLevel(level)
|
||||
logger.SetLevel(level)
|
||||
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (sLog *SchedPolicySwitchLogger) CreateLogFile(prefix string) {
|
||||
|
||||
filename := strings.Join([]string{prefix, config.SPSConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SPSConfig.AllowOnConsole
|
||||
if config.SPSConfig.Enabled {
|
||||
filename := strings.Join([]string{prefix, config.SPSConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SPSConfig.AllowOnConsole
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,33 +20,36 @@ func NewSchedTraceLogger(logType int, prefix string) *SchedTraceLogger {
|
|||
}
|
||||
|
||||
func (sLog SchedTraceLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if sLog.Type == logType {
|
||||
if config.SchedTraceConfig.Enabled {
|
||||
if sLog.Type == logType {
|
||||
|
||||
logger.SetLevel(level)
|
||||
logger.SetLevel(level)
|
||||
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (sLog *SchedTraceLogger) CreateLogFile(prefix string) {
|
||||
|
||||
filename := strings.Join([]string{prefix, config.SchedTraceConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SchedTraceConfig.AllowOnConsole
|
||||
if config.SchedTraceConfig.Enabled {
|
||||
filename := strings.Join([]string{prefix, config.SchedTraceConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SchedTraceConfig.AllowOnConsole
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,33 +20,36 @@ func NewSchedWindowLogger(logType int, prefix string) *SchedWindowLogger {
|
|||
}
|
||||
|
||||
func (sLog SchedWindowLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
|
||||
if sLog.Type == logType {
|
||||
if config.SchedWindowConfig.Enabled {
|
||||
if sLog.Type == logType {
|
||||
|
||||
logger.SetLevel(level)
|
||||
logger.SetLevel(level)
|
||||
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
if sLog.AllowOnConsole {
|
||||
logger.SetOutput(os.Stdout)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
|
||||
logger.SetOutput(sLog.LogFile)
|
||||
logger.WithFields(logData).Println(message)
|
||||
}
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
if sLog.next != nil {
|
||||
sLog.next.Log(logType, level, logData, message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (sLog *SchedWindowLogger) CreateLogFile(prefix string) {
|
||||
|
||||
filename := strings.Join([]string{prefix, config.SchedWindowConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SchedWindowConfig.AllowOnConsole
|
||||
if config.SchedWindowConfig.Enabled {
|
||||
filename := strings.Join([]string{prefix, config.SchedWindowConfig.FilenameExtension}, "")
|
||||
dirName := logDir.getDirName()
|
||||
if dirName != "" {
|
||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||
log.Fatal("Unable to create logFile: ", err)
|
||||
} else {
|
||||
sLog.LogFile = logFile
|
||||
sLog.AllowOnConsole = config.SchedWindowConfig.AllowOnConsole
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}
Where is log dir coming from? Shouldn't be a global