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 47 additions and 38 deletions
Showing only changes of commit 7996240b2e - Show all commits

View file

@ -38,8 +38,9 @@ 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) {
tskDistLogPrefix := strings.Join([]string{prefix, config.TaskDistConfig.FilenameExtension}, "")
if logDir != "" {
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{logDir, 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!
dirName := logDir.getDirName()
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 dirName != "" {
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{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

@ -35,8 +35,9 @@ func (cLog *ConsoleLogger) Log(logType int, level log.Level, logData log.Fields,
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
func (cLog *ConsoleLogger) SetLogFile(prefix string) {
consoleLogPrefix := strings.Join([]string{prefix, config.ConsoleConfig.FilenameExtension}, "")
if logDir != "" {
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{logDir, 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
dirName := logDir.getDirName()
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 dirName != "" {
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{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

@ -1,34 +1,37 @@
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
package elektronLogging
import (
logrus "github.com/sirupsen/logrus"
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
log "github.com/sirupsen/logrus"
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
"os"
"strconv"
"strings"
"time"
)
var logDir string
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
func GetLogDir(startTime time.Time, prefix string) {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
if logDir == "" {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDir = createLogDir(prefix, startTime)
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
type logDirectory struct {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
name string
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
func createLogDir(prefix string, startTime time.Time) string {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
// Creating directory to store all logs for this run
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName := strings.Join([]string{"./", prefix, strconv.Itoa(startTime.Year())}, "")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, startTime.Month().String(), strconv.Itoa(startTime.Day())}, "-")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, strconv.Itoa(startTime.Hour())}, "_")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, strconv.Itoa(startTime.Minute()), strconv.Itoa(startTime.Second())}, "-")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
if _, err := os.Stat(logDirName); os.IsNotExist(err) {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
os.Mkdir(logDirName, 0755)
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
} else {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logrus.Println("Unable to create log directory: ", err)
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = ""
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
return logDirName
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
func (logD *logDirectory) getDirName() string {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
return logD.name
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
func (logD *logDirectory) createLogDir(prefix string, startTime time.Time) {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
if logD.name == "" {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
// Creating directory to store all logs for this run
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName := strings.Join([]string{"./", prefix, strconv.Itoa(startTime.Year())}, "")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, startTime.Month().String(), strconv.Itoa(startTime.Day())}, "-")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, strconv.Itoa(startTime.Hour())}, "_")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = strings.Join([]string{logDirName, strconv.Itoa(startTime.Minute()), strconv.Itoa(startTime.Second())}, "-")
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
if _, err := os.Stat(logDirName); os.IsNotExist(err) {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
os.Mkdir(logDirName, 0755)
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
} else {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
log.Println("Unable to create log directory: ", err)
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logDirName = ""
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
logD.name = logDirName
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
}

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

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

Why not use string.join([]string{...}, "") ?

Why not use `string.join([]string{...}, "")` ?
balandi1 commented 2019-11-20 18:52:16 +00:00 (Migrated from github.com)

Yeah, thats right

Yeah, thats right
pradykaushik commented 2019-11-21 01:10:18 +00:00 (Migrated from github.com)

Extend the comment to show how the format of the log directory name is going to look.

Extend the comment to show how the format of the log directory name is going to look.
pradykaushik commented 2019-11-21 01:19:20 +00:00 (Migrated from github.com)

Keep the alias for logrus import consistent. So, refactor this to "log".

Keep the alias for logrus import consistent. So, refactor this to "log".
balandi1 commented 2019-11-26 17:44:43 +00:00 (Migrated from github.com)

Done

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

Done

Done

View file

@ -12,6 +12,7 @@ var config LoggerConfig
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`
var logger *log.Logger
var formatter ElektronFormatter
var ElektronLog *LoggerImpl
var logDir logDirectory
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`
func BuildLogger(prefix string) {
@ -22,10 +23,9 @@ 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`
startTime := time.Now()
formatter.TimestampFormat = "2006-01-02 15:04:05"
formattedStartTime := startTime.Format("20060102150405")
GetLogDir(startTime, "_")
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`
prefix = strings.Join([]string{prefix, formattedStartTime}, "_")
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`
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`
logDir.createLogDir(prefix, startTime)
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`
prefix = strings.Join([]string{prefix, formattedStartTime}, "_")
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`
logger = &log.Logger{
Out: os.Stderr,
Level: log.DebugLevel,

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

@ -38,8 +38,9 @@ func (pLog *PcpLogger) Log(logType int, level log.Level, logData log.Fields, mes
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
func (plog *PcpLogger) SetLogFile(prefix string) {
pcpLogPrefix := strings.Join([]string{prefix, config.PCPConfig.FilenameExtension}, "")
if logDir != "" {
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{logDir, 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
dirName := logDir.getDirName()
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 dirName != "" {
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{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

@ -38,8 +38,9 @@ func (sLog *SchedPolicySwitchLogger) Log(logType int, level log.Level, logData l
func (sLog *SchedPolicySwitchLogger) SetLogFile(prefix string) {
spsLogPrefix := strings.Join([]string{prefix, config.SPSConfig.FilenameExtension}, "")
if logDir != "" {
spsLogPrefix = strings.Join([]string{logDir, spsLogPrefix}, "/")
dirName := logDir.getDirName()
if dirName != "" {
spsLogPrefix = strings.Join([]string{dirName, spsLogPrefix}, "/")
}
if logFile, err := os.Create(spsLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

View file

@ -38,8 +38,9 @@ func (sLog *SchedTraceLogger) Log(logType int, level log.Level, logData log.Fiel
func (sLog *SchedTraceLogger) SetLogFile(prefix string) {
schedTraceLogPrefix := strings.Join([]string{prefix, config.SchedTraceConfig.FilenameExtension}, "")
if logDir != "" {
schedTraceLogPrefix = strings.Join([]string{logDir, schedTraceLogPrefix}, "/")
dirName := logDir.getDirName()
if dirName != "" {
schedTraceLogPrefix = strings.Join([]string{dirName, schedTraceLogPrefix}, "/")
}
if logFile, err := os.Create(schedTraceLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)

View file

@ -38,8 +38,9 @@ func (sLog *SchedWindowLogger) Log(logType int, level log.Level, logData log.Fie
func (sLog *SchedWindowLogger) SetLogFile(prefix string) {
schedWindowLogPrefix := strings.Join([]string{prefix, config.SchedWindowConfig.FilenameExtension}, "")
if logDir != "" {
schedWindowLogPrefix = strings.Join([]string{logDir, schedWindowLogPrefix}, "/")
dirName := logDir.getDirName()
if dirName != "" {
schedWindowLogPrefix = strings.Join([]string{dirName, schedWindowLogPrefix}, "/")
}
if logFile, err := os.Create(schedWindowLogPrefix); err != nil {
log.Fatal("Unable to create logFile: ", err)