WIP : Elektron Logging library #16

Merged
balandi1 merged 50 commits from master into master 2019-12-10 01:15:34 +00:00
8 changed files with 19 additions and 13 deletions
Showing only changes of commit eaac82ceb9 - Show all commits

View file

@ -109,7 +109,7 @@ func clusterSizeAvgMMMPU(tasks []Task, taskObservation func(task Task) []float64
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done
// skip this value
// there is an error in the task config.
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.ErrorLevel,
log.Fields{}, fmt.Sprintf("%s", err))
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done
log.Fields{}, err.Error())
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done
}
} else {
// There is only one observation for the task.

pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

I would alias this to elekLog as you seem to be using that prefix when aliasing imports of sub-packages.

I would alias this to _elekLog_ as you seem to be using that prefix when aliasing imports of sub-packages.
balandi1 commented 2019-11-21 19:30:07 +00:00 (Migrated from github.com)

Okay. Done

Okay. Done

View file

@ -3,21 +3,22 @@ package elektronLogging
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
"strings"
)
type ClsfnTaskDistOverheadLogger struct {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
type ClsfnTaskDistrOverheadLogger struct {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
LoggerImpl
}
func NewClsfnTaskDistOverheadLogger(logType int, prefix string) *ClsfnTaskDistOverheadLogger {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
cLog := &ClsfnTaskDistOverheadLogger{}
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
func NewClsfnTaskDistrOverheadLogger(logType int, prefix string) *ClsfnTaskDistrOverheadLogger {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
cLog := &ClsfnTaskDistrOverheadLogger{}
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
cLog.Type = logType
cLog.SetLogFile(prefix)
return cLog
}
func (cLog *ClsfnTaskDistOverheadLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
func (cLog *ClsfnTaskDistrOverheadLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
if cLog.Type == logType {
logger.SetLevel(level)
@ -35,12 +36,12 @@ func (cLog *ClsfnTaskDistOverheadLogger) Log(logType int, level log.Level, logDa
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
}
}
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
func (cLog *ClsfnTaskDistrOverheadLogger) SetLogFile(prefix string) {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
tskDistLogPrefix := strings.Join([]string{prefix, config.TaskDistConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
tskDistLogPrefix = strings.Join([]string{dirName, tskDistLogPrefix}, "/")
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
tskDistLogPrefix = filepath.Join(dirName, tskDistLogPrefix)
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
}
if logFile, err := os.Create(tskDistLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

Use struct literals instead of new as it's more descriptive:
&ClsfnTaskDistOverheadLogger{}

Use struct literals instead of new as it's more descriptive: `&ClsfnTaskDistOverheadLogger{}`
ridv commented 2019-11-19 03:49:35 +00:00 (Migrated from github.com)

Where is log dir coming from? Shouldn't be a global

Where is log dir coming from? Shouldn't be a global
balandi1 commented 2019-11-20 18:49:00 +00:00 (Migrated from github.com)

Okay, will do the changes

Okay, will do the changes
balandi1 commented 2019-11-20 18:52:01 +00:00 (Migrated from github.com)

It is defined in createLogDir.go. Since all these files belong to same package, I accessed it in this way.

It is defined in `createLogDir.go`. Since all these files belong to same package, I accessed it in this way.
pradykaushik commented 2019-11-21 00:50:06 +00:00 (Migrated from github.com)

I think it will be better if it is encapsulated.
Something like

type logDir struct {
    name string
    // other fields if necessary.
}
I think it will be better if it is encapsulated. Something like ```go type logDir struct { name string // other fields if necessary. } ```
pradykaushik commented 2019-11-21 00:52:08 +00:00 (Migrated from github.com)

Maybe refactor to ClsfnTaskDistrOverheadLogger so that it is clear that we are intending "Distribution" and now "Distance"?

Maybe refactor to `ClsfnTaskDistrOverheadLogger` so that it is clear that we are intending "Distribution" and now "Distance"?
pradykaushik commented 2019-11-21 00:57:11 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

You can possible rewrite this function to something like the one shown below.

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
        }
    }
}
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 } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:11:44 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 20:27:31 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-21 22:47:52 +00:00 (Migrated from github.com)

Done

Done
ridv commented 2019-11-24 18:46:34 +00:00 (Migrated from github.com)

looks good now thanks!

looks good now thanks!

View file

@ -3,6 +3,7 @@ package elektronLogging
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
"strings"
)
@ -37,7 +38,7 @@ func (cLog *ConsoleLogger) SetLogFile(prefix string) {
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
consoleLogPrefix := strings.Join([]string{prefix, config.ConsoleConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
consoleLogPrefix = strings.Join([]string{dirName, consoleLogPrefix}, "/")
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
consoleLogPrefix = filepath.Join(dirName, consoleLogPrefix)
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
}
if logFile, err := os.Create(consoleLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

I see why you are directly assigning true. However, to allow disabling console logs to stdout retrofit this to cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole.

I see why you are directly assigning `true`. However, to allow disabling console logs to stdout retrofit this to `cLog.AllowOnConsole = config.ConsoleConfig.AllowOnConsole`.
pradykaushik commented 2019-11-21 01:31:25 +00:00 (Migrated from github.com)

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.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

Sure
balandi1 commented 2019-11-21 22:52:32 +00:00 (Migrated from github.com)

Yeah, thats right. I will change it

Yeah, thats right. I will change it

View file

@ -39,7 +39,7 @@ func BuildLogger(prefix string) {
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
schedTraceLog := NewSchedTraceLogger(SCHED_TRACE, prefix)
spsLog := NewSchedPolicySwitchLogger(SPS, prefix)
schedWindowLog := NewSchedWindowLogger(SCHED_WINDOW, prefix)
tskDistLog := NewClsfnTaskDistOverheadLogger(CLSFN_TASKDIST_OVERHEAD, prefix)
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
tskDistLog := NewClsfnTaskDistrOverheadLogger(CLSFN_TASKDIST_OVERHEAD, prefix)
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
head.SetNext(cLog)
cLog.SetNext(pLog)

pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

Logger and Log are synonyms and therefore should not be used interchangeably.

Logger and Log are synonyms and therefore should not be used interchangeably.
pradykaushik commented 2019-11-21 01:23:28 +00:00 (Migrated from github.com)

Comments should start with capital letters and should end with a full stop.

Comments should start with capital letters and should end with a full stop.
pradykaushik commented 2019-11-21 01:26:47 +00:00 (Migrated from github.com)

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the -logPrefix flag.

The second argument to GetLogDir() is a prefix. How is "_" a prefix? This is probably why the log directory name is not ending up prefixed with the one specified with the `-logPrefix` flag.
pradykaushik commented 2019-11-21 01:33:09 +00:00 (Migrated from github.com)

What is the rationale behind having a dummy node as the head of the chain?

What is the rationale behind having a dummy node as the head of the chain?
balandi1 commented 2019-11-26 17:44:22 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 18:53:15 +00:00 (Migrated from github.com)

Nothing specific. I had kept ElektronLog as LoggerImpl type. But I have changed to ConsoleLogger rather. Works fine now

Nothing specific. I had kept `ElektronLog` as `LoggerImpl` type. But I have changed to `ConsoleLogger` rather. Works fine now
balandi1 commented 2019-11-26 18:58:23 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 19:05:09 +00:00 (Migrated from github.com)

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`

View file

@ -3,6 +3,7 @@ package elektronLogging
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
"strings"
)
@ -40,7 +41,7 @@ func (plog *PcpLogger) SetLogFile(prefix string) {
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
pcpLogPrefix := strings.Join([]string{prefix, config.PCPConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
pcpLogPrefix = strings.Join([]string{dirName, pcpLogPrefix}, "/")
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
pcpLogPrefix = filepath.Join(dirName, pcpLogPrefix)
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
}
if logFile, err := os.Create(pcpLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

Refactor to `PCPLogger`.
pradykaushik commented 2019-11-21 02:56:21 +00:00 (Migrated from github.com)

Why not just do this?

return &PCPLogger{ 
    LoggerIml{
        Type: logType
        LogFile: CreateLogFile(prefix),
    }
}

Where func CreateLogFile(prefix string) string replaces func SetLogFile(prefix string).

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)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done

View file

@ -3,6 +3,7 @@ package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
)
@ -40,7 +41,7 @@ func (sLog *SchedPolicySwitchLogger) SetLogFile(prefix string) {
spsLogPrefix := strings.Join([]string{prefix, config.SPSConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
spsLogPrefix = strings.Join([]string{dirName, spsLogPrefix}, "/")
spsLogPrefix = filepath.Join(dirName, spsLogPrefix)
}
if logFile, err := os.Create(spsLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

View file

@ -3,6 +3,7 @@ package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
)
@ -40,7 +41,7 @@ func (sLog *SchedTraceLogger) SetLogFile(prefix string) {
schedTraceLogPrefix := strings.Join([]string{prefix, config.SchedTraceConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
schedTraceLogPrefix = strings.Join([]string{dirName, schedTraceLogPrefix}, "/")
schedTraceLogPrefix = filepath.Join(dirName, schedTraceLogPrefix)
}
if logFile, err := os.Create(schedTraceLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

View file

@ -3,6 +3,7 @@ package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
)
@ -40,7 +41,7 @@ func (sLog *SchedWindowLogger) SetLogFile(prefix string) {
schedWindowLogPrefix := strings.Join([]string{prefix, config.SchedWindowConfig.FilenameExtension}, "")
dirName := logDir.getDirName()
if dirName != "" {
schedWindowLogPrefix = strings.Join([]string{dirName, schedWindowLogPrefix}, "/")
schedWindowLogPrefix = filepath.Join(dirName, schedWindowLogPrefix)
}
if logFile, err := os.Create(schedWindowLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)