WIP : Elektron Logging library #16

Merged
balandi1 merged 50 commits from master into master 2019-12-10 01:15:34 +00:00
24 changed files with 254 additions and 254 deletions
Showing only changes of commit 9952b9861d - Show all commits

View file

@ -25,7 +25,7 @@ import (
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
"github.com/mash/gokmeans"
"github.com/montanaflynn/stats"
log "github.com/sirupsen/logrus"
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
)
@ -52,8 +52,8 @@ func (tc TasksToClassify) taskObservationCalculator(task Task) []float64 {
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
} else if task.Watts != 0.0 {
return []float64{task.Watts}
} else {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR, log.FatalLevel,
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

Okay. Done
log.Fields{}, "Unable to classify tasks. Missing Watts or ClassToWatts attribute in workload")
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

Okay. Done
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR, elekLog.FatalLevel,
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

Okay. Done
elekLog.Fields{}, "Unable to classify tasks. Missing Watts or ClassToWatts attribute in workload")
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

Okay. Done
return []float64{0.0} // Won't reach here.
}
}
@ -108,8 +108,8 @@ func clusterSizeAvgMMMPU(tasks []Task, taskObservation func(task Task) []float64
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
} else {
// skip this value
// there is an error in the task config.
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR, log.ErrorLevel,
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR, elekLog.ErrorLevel,
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

Okay. Done
elekLog.Fields{}, fmt.Sprintf("%s", err))
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done

View file

@ -3,7 +3,7 @@ package elektronLogging
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
import (
"bytes"
"github.com/fatih/color"
log "github.com/sirupsen/logrus"
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
elekLog "github.com/sirupsen/logrus"
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
"strings"
)
@ -11,21 +11,21 @@ type ElektronFormatter struct {
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
TimestampFormat string
}
func (f ElektronFormatter) getColor(entry *log.Entry) *color.Color {
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
func (f ElektronFormatter) getColor(entry *elekLog.Entry) *color.Color {
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
switch entry.Level {
case log.InfoLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
case elekLog.InfoLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
return color.New(color.FgGreen, color.Bold)
case log.WarnLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
case elekLog.WarnLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
return color.New(color.FgYellow, color.Bold)
case log.ErrorLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
case elekLog.ErrorLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
return color.New(color.FgRed, color.Bold)
case log.FatalLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
case elekLog.FatalLevel:
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
return color.New(color.FgRed, color.Bold)
default:
return color.New(color.FgWhite, color.Bold)
}
}
func (f ElektronFormatter) Format(entry *log.Entry) ([]byte, error) {
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
func (f ElektronFormatter) Format(entry *elekLog.Entry) ([]byte, error) {
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
var b *bytes.Buffer
if entry.Buffer != nil {

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

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay
ridv commented 2019-11-19 02:56:40 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:57:02 +00:00 (Migrated from github.com)

Formatting

Formatting
ridv commented 2019-11-19 02:59:56 +00:00 (Migrated from github.com)

Use strings.join instead. You should create the slice and append the message if necessary.

Use [strings.join](https://golang.org/pkg/strings/#Join) instead. You should create the slice and append the message if necessary.
ridv commented 2019-11-19 03:00:54 +00:00 (Migrated from github.com)

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.

This seems really inefficient. Wouldn't value already have to be a string for this to succeed? In which case, I don't think we gain anything here by suing a sprintf.
balandi1 commented 2019-11-20 18:48:25 +00:00 (Migrated from github.com)

Okay. Sure

Okay. Sure
balandi1 commented 2019-11-20 19:42:41 +00:00 (Migrated from github.com)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : value.(string)

value is not a string here, it is of type interface{}. But to avoid using sprintf, would it be fine to use type assertion? For eg : `value.(string) `
balandi1 commented 2019-11-21 18:07:31 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-21 18:07:42 +00:00 (Migrated from github.com)

Done

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

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.

Line 43 and 44 can fit in one line. We currently do not have any style linting setup.
pradykaushik commented 2019-11-21 22:59:52 +00:00 (Migrated from github.com)

Peeked at how logrus serializes values and seems like fmt.Sprint is used if type assertion fails.

Peeked at how [logrus](https://github.com/sirupsen/logrus/blob/67a7fdcf741f4d5cee82cb9800994ccfd4393ad0/text_formatter.go#L315) serializes values and seems like fmt.Sprint is used if type assertion fails.
ridv commented 2019-11-24 18:46:09 +00:00 (Migrated from github.com)

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.

ahh alright, I thought it was a string coming in. Alright, if it's been sanity checked then i'm good with it.
balandi1 commented 2019-11-26 18:14:34 +00:00 (Migrated from github.com)

Okay

Okay

View file

@ -1,7 +1,7 @@
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!
package elektronLogging
import (
log "github.com/sirupsen/logrus"
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!
elekLog "github.com/sirupsen/logrus"
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!
"os"
"strings"
)
@ -17,7 +17,7 @@ func NewClsfnTaskDistOverheadLogger(logType int, prefix string) *ClsfnTaskDistOv
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!
return cLog
}
func (cLog *ClsfnTaskDistOverheadLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
ridv commented 2019-11-19 03:01:56 +00:00 (Migrated from github.com)

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

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

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

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

Okay, will do the changes

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

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

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

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

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

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

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

You should use filepath.Join(...) to keep it generic.

You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

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

func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
    filename := prefix + config.TaskDistConfig.FilenameExtension
    if logDir != "" {
        if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
            log.Fatal("Unable to create logFile: ", err)
        } else {
            cLog.LogFileName = logFile
            cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
        }
    }
}
You can possible rewrite this function to something like the one shown below. ```go func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) { filename := prefix + config.TaskDistConfig.FilenameExtension if logDir != "" { if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil { log.Fatal("Unable to create logFile: ", err) } else { cLog.LogFileName = logFile cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

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

Done

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

Okay. Sure

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

Done

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

looks good now thanks!

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

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

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

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

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

Okay, will do the changes

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

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

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

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

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

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

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

You should use filepath.Join(...) to keep it generic.

You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

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

func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
    filename := prefix + config.TaskDistConfig.FilenameExtension
    if logDir != "" {
        if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
            log.Fatal("Unable to create logFile: ", err)
        } else {
            cLog.LogFileName = logFile
            cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
        }
    }
}
You can possible rewrite this function to something like the one shown below. ```go func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) { filename := prefix + config.TaskDistConfig.FilenameExtension if logDir != "" { if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil { log.Fatal("Unable to create logFile: ", err) } else { cLog.LogFileName = logFile cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

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

Done

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

Okay. Sure

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

Done

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

looks good now thanks!

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

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

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

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

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

Okay, will do the changes

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

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

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

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

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

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

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

You should use filepath.Join(...) to keep it generic.

You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

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

func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
    filename := prefix + config.TaskDistConfig.FilenameExtension
    if logDir != "" {
        if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
            log.Fatal("Unable to create logFile: ", err)
        } else {
            cLog.LogFileName = logFile
            cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
        }
    }
}
You can possible rewrite this function to something like the one shown below. ```go func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) { filename := prefix + config.TaskDistConfig.FilenameExtension if logDir != "" { if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil { log.Fatal("Unable to create logFile: ", err) } else { cLog.LogFileName = logFile cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

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

Done

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

Okay. Sure

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

Done

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

looks good now thanks!

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

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

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

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

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

Okay, will do the changes

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

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

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

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

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

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

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

You should use filepath.Join(...) to keep it generic.

You should use [filepath.Join(...)](https://golang.org/src/path/filepath/path.go?s=5893:5925#L199) to keep it generic.
pradykaushik commented 2019-11-21 01:06:38 +00:00 (Migrated from github.com)

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

func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
    filename := prefix + config.TaskDistConfig.FilenameExtension
    if logDir != "" {
        if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil {
            log.Fatal("Unable to create logFile: ", err)
        } else {
            cLog.LogFileName = logFile
            cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole
        }
    }
}
You can possible rewrite this function to something like the one shown below. ```go func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) { filename := prefix + config.TaskDistConfig.FilenameExtension if logDir != "" { if logFile, err := os.Create(filepath.Join(logDir, filename)); err != nil { log.Fatal("Unable to create logFile: ", err) } else { cLog.LogFileName = logFile cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole } } } ```
balandi1 commented 2019-11-21 18:48:26 +00:00 (Migrated from github.com)

Done

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

Done

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

Okay. Sure

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

Done

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

looks good now thanks!

looks good now thanks!
func (cLog *ClsfnTaskDistOverheadLogger) SetLogFile(prefix string) {
tskDistLogPrefix := strings.Join([]string{prefix, config.TaskDistConfig.FilenameExtension}, "")
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!
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 != "" {
tskDistLogPrefix = strings.Join([]string{dirName, tskDistLogPrefix}, "/")
}
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!
elekLog.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!
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = config.TaskDistConfig.AllowOnConsole

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

@ -1,7 +1,7 @@
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
package elektronLogging
import (
log "github.com/sirupsen/logrus"
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
elekLog "github.com/sirupsen/logrus"
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
"os"
"strings"
)
@ -16,7 +16,7 @@ func NewConsoleLogger(logType int, prefix string) *ConsoleLogger {
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
cLog.SetLogFile(prefix)
return cLog
}
func (cLog *ConsoleLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

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

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

Why the pointer receiver? Technically, this function should not lead to change of state.

Why the pointer receiver? Technically, this function should not lead to change of state.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

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

Yeah, thats right. I will change it

Yeah, thats right. I will change it
func (cLog *ConsoleLogger) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
pradykaushik commented 2019-11-21 01:18:14 +00:00 (Migrated from github.com)

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

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

Why the pointer receiver? Technically, this function should not lead to change of state.

Why the pointer receiver? Technically, this function should not lead to change of state.
balandi1 commented 2019-11-21 22:47:38 +00:00 (Migrated from github.com)

Sure

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

Yeah, thats right. I will change it

Yeah, thats right. I will change it
if logType <= cLog.Type {
logger.SetLevel(level)
@ -35,12 +35,12 @@ 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}, "")
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
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 != "" {
consoleLogPrefix = strings.Join([]string{dirName, consoleLogPrefix}, "/")
}
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
elekLog.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
} else {
cLog.LogFileName = logFile
cLog.AllowOnConsole = true

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,7 +1,7 @@
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 (
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
elekLog "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"
@ -9,29 +9,29 @@ import (
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 {
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
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 (logD *logDirectory) getDirName() string {
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
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
}
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
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
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
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
elekLog.Println("Unable to create elekLog 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

@ -1,7 +1,7 @@
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`
package elektronLogging
import (
log "github.com/sirupsen/logrus"
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`
elekLog "github.com/sirupsen/logrus"
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`
. "github.com/spdfg/elektron/elektronLogging/types"
"os"
"strings"
@ -9,7 +9,7 @@ import (
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 config LoggerConfig
var logger *log.Logger
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 *elekLog.Logger
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 formatter ElektronFormatter
var ElektronLog *LoggerImpl
var logDir logDirectory
@ -19,16 +19,16 @@ 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`
// read configuration from yaml
config.GetConfig()
// create the log directory
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`
// create the elekLog directory
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")
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)
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{
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 = &elekLog.Logger{
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`
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`
Level: elekLog.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`
Formatter: &formatter,
}

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

@ -1,13 +1,13 @@
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

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

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

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

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
elekLog "github.com/sirupsen/logrus"
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
"os"
)
type Logger interface {
SetNext(logType Logger)
Log(logType int, level log.Level, logData log.Fields, message string)
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
Log(logType int, level elekLog.Level, logData elekLog.Fields, message string)
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
SetLogFile(prefix string)
}
type LoggerImpl struct {
@ -21,7 +21,7 @@ func (l *LoggerImpl) SetNext(logType Logger) {
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

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

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
l.next = logType
}
func (l *LoggerImpl) Log(logType int, level log.Level, logData log.Fields, message string) {
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
func (l *LoggerImpl) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
ridv commented 2019-11-19 03:52:10 +00:00 (Migrated from github.com)

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done
if l.next != nil {
l.next.Log(logType, level, logData, message)
}

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

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

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

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.

If the code isn't needed it shouldn't be left here. If the commented out code is still needed there should be some justification for it still being here.
balandi1 commented 2019-11-20 18:52:44 +00:00 (Migrated from github.com)

Okay. Will remove the unnecessary code

Okay. Will remove the unnecessary code
pradykaushik commented 2019-11-21 02:36:05 +00:00 (Migrated from github.com)

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all.
I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a WithFields(...) method that wraps around logrus.WithFields(...).
I have created this sample code for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around logrus.Logf(...) for that.

As fields are optional, it is better to either have them as the last argument or not have them in the argument list at all. I would in fact also maintain an internal data structure to store Fields that is cleared only after the log operation passes through the entire chain. You can then add a `WithFields(...)` method that wraps around `logrus.WithFields(...)`. I have created [this sample code](https://play.golang.org/p/RILTxcZtT2w) for reference. The sample code also shows how formatted strings are corresponding args can be passed and we can wrap around `logrus.Logf(...)` for that.
pradykaushik commented 2019-11-21 02:51:18 +00:00 (Migrated from github.com)

Refactor to LogFile as it is a pointer to os.File and not string.

Refactor to `LogFile` as it is a pointer to os.File and not string.
balandi1 commented 2019-11-26 17:46:53 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-04 18:18:20 +00:00 (Migrated from github.com)

Done

Done

View file

@ -1,7 +1,7 @@
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

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

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
package elektronLogging
import (
log "github.com/sirupsen/logrus"
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
elekLog "github.com/sirupsen/logrus"
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
elekEnv "github.com/spdfg/elektron/environment"
"gopkg.in/yaml.v2"
"io/ioutil"
@ -57,11 +57,11 @@ func (c *LoggerConfig) GetConfig() *LoggerConfig {
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

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

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
yamlFile, err := ioutil.ReadFile(elekEnv.LogConfigYaml)
if err != nil {
log.Printf("yamlFile.Get err #%v ", err)
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
elekLog.Printf("yamlFile.Get err #%v ", err)
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
}
err = yaml.Unmarshal(yamlFile, c)
if err != nil {
log.Fatalf("Unmarshal: %v", err)
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
elekLog.Fatalf("Unmarshal: %v", err)
pradykaushik commented 2019-11-21 02:43:54 +00:00 (Migrated from github.com)

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done
}
return c

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

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

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

Are column headers being added if enabled?

Are column headers being added if enabled?
pradykaushik commented 2019-11-21 02:45:05 +00:00 (Migrated from github.com)

Refactor to TaskDistrConfig for semantics.

Refactor to TaskDistrConfig for semantics.
pradykaushik commented 2019-11-21 02:45:19 +00:00 (Migrated from github.com)

ditto.

ditto.
pradykaushik commented 2019-11-21 02:47:43 +00:00 (Migrated from github.com)

The error message does not do justice in indicating the reason for the error.

The error message does not do justice in indicating the reason for the error.
pradykaushik commented 2019-11-21 02:47:53 +00:00 (Migrated from github.com)

ditto.

ditto.
balandi1 commented 2019-11-26 17:08:06 +00:00 (Migrated from github.com)

That was for future purpose. But I have removed it now

That was for future purpose. But I have removed it now
balandi1 commented 2019-11-26 17:45:42 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:45:56 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-11-26 17:46:29 +00:00 (Migrated from github.com)

Changed the error message

Changed the error message
balandi1 commented 2019-11-26 17:46:41 +00:00 (Migrated from github.com)

Done

Done

View file

@ -1,7 +1,7 @@
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
package elektronLogging
import (
log "github.com/sirupsen/logrus"
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
elekLog "github.com/sirupsen/logrus"
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
"os"
"strings"
)
@ -17,7 +17,7 @@ func NewPcpLogger(logType int, prefix string) *PcpLogger {
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
return pLog
}
func (pLog *PcpLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

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

Why not just do this?

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

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

Why not just do this? ```go return &PCPLogger{ LoggerIml{ Type: logType LogFile: CreateLogFile(prefix), } } ``` Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
func (pLog *PcpLogger) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
pradykaushik commented 2019-11-21 02:51:27 +00:00 (Migrated from github.com)

Refactor to PCPLogger.

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

Why not just do this?

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

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

Why not just do this? ```go return &PCPLogger{ LoggerIml{ Type: logType LogFile: CreateLogFile(prefix), } } ``` Where `func CreateLogFile(prefix string) string` replaces `func SetLogFile(prefix string)`.
balandi1 commented 2019-11-26 17:47:03 +00:00 (Migrated from github.com)

Done

Done
if pLog.Type == logType {
logger.SetLevel(level)
@ -38,12 +38,12 @@ 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}, "")
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
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 != "" {
pcpLogPrefix = strings.Join([]string{dirName, pcpLogPrefix}, "/")
}
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
elekLog.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
} else {
plog.LogFileName = logFile
plog.AllowOnConsole = config.PCPConfig.AllowOnConsole

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

@ -1,7 +1,7 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"os"
"strings"
)
@ -17,7 +17,7 @@ func NewSchedPolicySwitchLogger(logType int, prefix string) *SchedPolicySwitchLo
return sLog
}
func (sLog *SchedPolicySwitchLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
func (sLog *SchedPolicySwitchLogger) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
if sLog.Type == logType {
logger.SetLevel(level)
@ -38,12 +38,12 @@ 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}, "")
dirName := logDir.getDirName()
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)
elekLog.Fatal("Unable to create logFile: ", err)
} else {
sLog.LogFileName = logFile
sLog.AllowOnConsole = config.SPSConfig.AllowOnConsole

View file

@ -1,7 +1,7 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"os"
"strings"
)
@ -17,7 +17,7 @@ func NewSchedTraceLogger(logType int, prefix string) *SchedTraceLogger {
return sLog
}
func (sLog *SchedTraceLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
func (sLog *SchedTraceLogger) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
if sLog.Type == logType {
logger.SetLevel(level)
@ -38,12 +38,12 @@ 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}, "")
dirName := logDir.getDirName()
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)
elekLog.Fatal("Unable to create logFile: ", err)
} else {
sLog.LogFileName = logFile
sLog.AllowOnConsole = config.SchedTraceConfig.AllowOnConsole

View file

@ -1,7 +1,7 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"os"
"strings"
)
@ -17,7 +17,7 @@ func NewSchedWindowLogger(logType int, prefix string) *SchedWindowLogger {
return sLog
}
func (sLog *SchedWindowLogger) Log(logType int, level log.Level, logData log.Fields, message string) {
func (sLog *SchedWindowLogger) Log(logType int, level elekLog.Level, logData elekLog.Fields, message string) {
if sLog.Type == logType {
logger.SetLevel(level)
@ -38,12 +38,12 @@ 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}, "")
dirName := logDir.getDirName()
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)
elekLog.Fatal("Unable to create logFile: ", err)
} else {
sLog.LogFileName = logFile
sLog.AllowOnConsole = config.SchedWindowConfig.AllowOnConsole

View file

@ -24,7 +24,7 @@ import (
"syscall"
"time"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/elektronLogging"
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
)
@ -36,7 +36,7 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
pipe, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
//cmd.Stdout = stdout
@ -48,8 +48,8 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
// Write to logfile
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
elekLog.InfoLevel,
elekLog.Fields{}, scanner.Text())
// Throw away first set of results
scanner.Scan()
@ -61,8 +61,8 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
if *logging {
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields{}, text)
elekLog.InfoLevel,
elekLog.Fields{}, text)
}
seconds++
@ -70,11 +70,11 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
}(logging)
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
log.InfoLevel,
log.Fields{}, "PCP logging started")
elekLog.InfoLevel,
elekLog.Fields{}, "PCP logging started")
if err := cmd.Start(); err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
pgid, err := syscall.Getpgid(cmd.Process.Pid)
@ -82,8 +82,8 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
select {
case <-quit:
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
elekLog.InfoLevel,
elekLog.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)
// http://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly

View file

@ -29,7 +29,7 @@ import (
"syscall"
"time"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
"github.com/spdfg/elektron/pcp"
@ -44,13 +44,13 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
if hiThreshold < loThreshold {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "High threshold is lower than low threshold!")
elekLog.InfoLevel,
elekLog.Fields{}, "High threshold is lower than low threshold!")
}
pipe, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
//cmd.Stdout = stdout
@ -62,8 +62,8 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
// Write to logfile
elektronLogging.ElektronLog.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
elekLog.InfoLevel,
elekLog.Fields{}, scanner.Text())
headers := strings.Split(scanner.Text(), ",")
@ -100,15 +100,15 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
if *logging {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Logging PCP...")
elekLog.InfoLevel,
elekLog.Fields{}, "Logging PCP...")
text := scanner.Text()
split := strings.Split(text, ",")
elektronLogging.ElektronLog.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, text)
elekLog.InfoLevel,
elekLog.Fields{}, text)
totalPower := 0.0
for _, powerIndex := range powerIndexes {
@ -120,8 +120,8 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
powerHistories[host] = powerHistories[host].Next()
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
elekLog.InfoLevel,
elekLog.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
"")
totalPower += power
@ -134,15 +134,15 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
clusterMean := pcp.AverageClusterPowerHistory(clusterPowerHist)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
elekLog.InfoLevel,
elekLog.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
"Sec Avg": fmt.Sprintf("%f", clusterMean)},
"")
if clusterMean > hiThreshold {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Need to cap a node")
elekLog.InfoLevel,
elekLog.Fields{}, "Need to cap a node")
// Create statics for all victims and choose one to cap
victims := make([]pcp.Victim, 0, 8)
@ -164,13 +164,13 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
cappedHosts[victim.Host] = true
orderCapped = append(orderCapped, victim.Host)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Capping Victim": fmt.Sprintf("%s", victim.Host),
elekLog.InfoLevel,
elekLog.Fields{"Capping Victim": fmt.Sprintf("%s", victim.Host),
"Avg. Wattage": fmt.Sprintf("%f", victim.Watts*pcp.RAPLUnits)}, "")
if err := rapl.Cap(victim.Host, "rapl", 50); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{}, "Error capping host")
elekLog.ErrorLevel,
elekLog.Fields{}, "Error capping host")
}
break // Only cap one machine at at time.
}
@ -183,14 +183,14 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
orderCapped = orderCapped[:len(orderCapped)-1]
cappedHosts[host] = false
// User RAPL package to send uncap.
log.Printf("Uncapping host %s", host)
elekLog.Printf("Uncapping host %s", host)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Uncapped host": host}, "")
elekLog.InfoLevel,
elekLog.Fields{"Uncapped host": host}, "")
if err := rapl.Cap(host, "rapl", 100); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{}, "Error capping host")
elekLog.ErrorLevel,
elekLog.Fields{}, "Error capping host")
}
}
}
@ -201,11 +201,11 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
}(logging, hiThreshold, loThreshold)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "PCP logging started")
elekLog.InfoLevel,
elekLog.Fields{}, "PCP logging started")
if err := cmd.Start(); err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
pgid, err := syscall.Getpgid(cmd.Process.Pid)
@ -213,8 +213,8 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
select {
case <-quit:
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
elekLog.InfoLevel,
elekLog.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)
// http://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly

View file

@ -30,7 +30,7 @@ import (
"syscall"
"time"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/constants"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -57,13 +57,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
if hiThreshold < loThreshold {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "High threshold is lower than low threshold!")
elekLog.InfoLevel,
elekLog.Fields{}, "High threshold is lower than low threshold!")
}
pipe, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
//cmd.Stdout = stdout
@ -75,8 +75,8 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
// Write to logfile
elektronLogging.ElektronLog.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
elekLog.InfoLevel,
elekLog.Fields{}, scanner.Text())
headers := strings.Split(scanner.Text(), ",")
@ -116,14 +116,14 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
for scanner.Scan() {
if *logging {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Logging PCP...")
elekLog.InfoLevel,
elekLog.Fields{}, "Logging PCP...")
split := strings.Split(scanner.Text(), ",")
text := scanner.Text()
elektronLogging.ElektronLog.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, text)
elekLog.InfoLevel,
elekLog.Fields{}, text)
totalPower := 0.0
for _, powerIndex := range powerIndexes {
@ -135,8 +135,8 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
powerHistories[host] = powerHistories[host].Next()
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
elekLog.InfoLevel,
elekLog.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
"")
totalPower += power
}
@ -148,23 +148,23 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
clusterMean := pcp.AverageClusterPowerHistory(clusterPowerHist)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
elekLog.InfoLevel,
elekLog.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
"Sec Avg": fmt.Sprintf("%f", clusterMean)},
"")
if clusterMean >= hiThreshold {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Need to cap a node")
elekLog.InfoLevel,
elekLog.Fields{}, "Need to cap a node")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
// Create statics for all victims and choose one to cap
victims := make([]pcp.Victim, 0, 8)
@ -193,13 +193,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
if err := rapl.Cap(victims[i].Host, "rapl", 50.0); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{"Error capping host": fmt.Sprintf("%s", victims[i].Host)}, "")
elekLog.ErrorLevel,
elekLog.Fields{"Error capping host": fmt.Sprintf("%s", victims[i].Host)}, "")
} else {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, fmt.Sprintf("Capped host[%s] at %f", victims[i].Host, 50.0))
elekLog.InfoLevel,
elekLog.Fields{}, fmt.Sprintf("Capped host[%s] at %f", victims[i].Host, 50.0))
// Keeping track of this victim and it's cap value
cappedVictims[victims[i].Host] = 50.0
newVictimFound = true
@ -224,13 +224,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
if err := rapl.Cap(alreadyCappedHosts[i], "rapl", newCapValue); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{"Error capping host": fmt.Sprintf("%s", alreadyCappedHosts[i])}, "")
elekLog.ErrorLevel,
elekLog.Fields{"Error capping host": fmt.Sprintf("%s", alreadyCappedHosts[i])}, "")
} else {
// Successful cap
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, fmt.Sprintf("Capped host[%s] at %f", alreadyCappedHosts[i], newCapValue))
elekLog.InfoLevel,
elekLog.Fields{}, fmt.Sprintf("Capped host[%s] at %f", alreadyCappedHosts[i], newCapValue))
// Checking whether this victim can be capped further
if newCapValue <= constants.LowerCapLimit {
// Deleting victim from cappedVictims.
@ -254,22 +254,22 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}
if !canCapAlreadyCappedVictim {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "No Victim left to cap")
elekLog.InfoLevel,
elekLog.Fields{}, "No Victim left to cap")
}
}
} else if clusterMean < loThreshold {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Need to uncap a node")
elekLog.InfoLevel,
elekLog.Fields{}, "Need to uncap a node")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
if len(orderCapped) > 0 {
// We pick the host that is capped the most to uncap.
orderCappedToSort := utilities.GetPairList(orderCappedVictims)
@ -281,13 +281,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
if err := rapl.Cap(hostToUncap, "rapl", newUncapValue); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{"Error uncapping host": fmt.Sprintf("%s", hostToUncap)}, "")
elekLog.ErrorLevel,
elekLog.Fields{"Error uncapping host": fmt.Sprintf("%s", hostToUncap)}, "")
} else {
// Successful uncap
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, fmt.Sprintf("Uncapped host[%s] to %f", hostToUncap, newUncapValue))
elekLog.InfoLevel,
elekLog.Fields{}, fmt.Sprintf("Uncapped host[%s] to %f", hostToUncap, newUncapValue))
// Can we uncap this host further. If not, then we remove its entry from orderCapped
if newUncapValue >= 100.0 { // can compare using ==
// Deleting entry from orderCapped
@ -309,8 +309,8 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}
} else {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "No host staged for Uncapped")
elekLog.InfoLevel,
elekLog.Fields{}, "No host staged for Uncapped")
}
}
}
@ -320,10 +320,10 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}(logging, hiThreshold, loThreshold)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "PCP logging started")
elekLog.InfoLevel,
elekLog.Fields{}, "PCP logging started")
if err := cmd.Start(); err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
pgid, err := syscall.Getpgid(cmd.Process.Pid)
@ -331,8 +331,8 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
select {
case <-quit:
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
elekLog.InfoLevel,
elekLog.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)
// http://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly

View file

@ -24,7 +24,7 @@ import (
"github.com/golang/protobuf/proto"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -104,7 +104,7 @@ func main() {
if *schedPolicyName != "first-fit" {
if _, ok := schedulers.SchedPolicies[*schedPolicyName]; !ok {
// invalid scheduling policy
log.Println("Invalid scheduling policy given. The possible scheduling policies are:")
elekLog.Println("Invalid scheduling policy given. The possible scheduling policies are:")
listAllSchedulingPolicies()
os.Exit(1)
}
@ -130,7 +130,7 @@ func main() {
if *enableSchedPolicySwitch {
// Scheduling policy config file required.
if spcf := *schedPolConfigFile; spcf == "" {
log.Fatal("Scheduling policy characteristics file not provided.")
elekLog.Fatal("Scheduling policy characteristics file not provided.")
} else {
// Initializing the characteristics of the scheduling policies.
schedulers.InitSchedPolicyCharacteristics(spcf)
@ -148,7 +148,7 @@ func main() {
// If CMW is disabled, then the Median of Medians Max Peak Power Usage value is used
// as the watts value for each task.
if *wattsAsAResource {
log.Println("WaaR enabled...")
elekLog.Println("WaaR enabled...")
schedOptions = append(schedOptions, schedulers.WithWattsAsAResource(*wattsAsAResource))
schedOptions = append(schedOptions, schedulers.WithClassMapWatts(*classMapWatts))
}
@ -165,7 +165,7 @@ func main() {
"prog-extrema": {},
}
if _, ok := powercapValues[*powerCapPolicy]; !ok {
log.Fatal("Incorrect power-capping algorithm specified.")
elekLog.Fatal("Incorrect power-capping algorithm specified.")
} else {
// Indicating which power capping algorithm to use, if any.
// The pcp-logging with/without power capping will be run after the
@ -185,7 +185,7 @@ func main() {
// These values are not used to configure the scheduler.
// hiThreshold and loThreshold are passed to the powercappers.
if *hiThreshold < *loThreshold {
log.Fatal("High threshold is of a lower value than low " +
elekLog.Fatal("High threshold is of a lower value than low " +
"threshold.")
}
}
@ -195,11 +195,11 @@ func main() {
// Tasks
// If httpServer is disabled, then path of file containing workload needs to be provided.
if *tasksFile == "" {
log.Fatal("Tasks specifications file not provided.")
elekLog.Fatal("Tasks specifications file not provided.")
}
tasks, err := def.TasksFromJSON(*tasksFile)
if err != nil || len(tasks) == 0 {
log.Fatal("Invalid tasks specification file provided.")
elekLog.Fatal("Invalid tasks specification file provided.")
}
schedOptions = append(schedOptions, schedulers.WithTasks(tasks))
@ -216,12 +216,12 @@ func main() {
Scheduler: scheduler,
})
if err != nil {
log.Fatal(fmt.Sprintf("Unable to create scheduler driver: %s", err))
elekLog.Fatal(fmt.Sprintf("Unable to create scheduler driver: %s", err))
}
// Checking if prefix contains any special characters.
if strings.Contains(*pcplogPrefix, "/") {
log.Fatal("log file prefix should not contain '/'.")
elekLog.Fatal("elekLog file prefix should not contain '/'.")
}
elektronLogging.BuildLogger(*pcplogPrefix)
@ -236,7 +236,7 @@ func main() {
*loThreshold, *pcpConfigFile)
}
// Take a second between starting PCP log and continuing.
// Take a second between starting PCP elekLog and continuing.
time.Sleep(1 * time.Second)
// Attempt to handle SIGINT to not leave pmdumptext running.
@ -250,7 +250,7 @@ func main() {
return
}
log.Println("Received SIGINT... stopping")
elekLog.Println("Received SIGINT... stopping")
close(done)
}()
@ -266,7 +266,7 @@ func main() {
select {
case <-done:
close(pcpLog)
time.Sleep(5 * time.Second) //Wait for PCP to log a few more seconds
time.Sleep(5 * time.Second) //Wait for PCP to elekLog a few more seconds
// Closing logging channels.
//case <-time.After(shutdownTimeout):
}
@ -279,10 +279,10 @@ func main() {
// Starting the scheduler driver.
if status, err := driver.Run(); err != nil {
elektronLogging.ElektronLog.Log(elekLogTypes.ERROR,
log.ErrorLevel,
log.Fields{"status": status.String(), "error": err.Error()}, "Framework stopped ")
elekLog.ErrorLevel,
elekLog.Fields{"status": status.String(), "error": err.Error()}, "Framework stopped ")
}
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "Exiting...")
elekLog.InfoLevel,
elekLog.Fields{}, "Exiting...")
}

View file

@ -19,7 +19,7 @@
package schedulers
import (
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
@ -39,7 +39,7 @@ func (s *MaxGreedyMins) takeOffer(spc SchedPolicyContext, offer *mesos.Offer, ta
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration
log.Fatal(err)
elekLog.Fatal(err)
}
if (cpus >= (totalCPU + task.CPU)) && (mem >= (totalRAM + task.RAM)) &&
(!baseSchedRef.wattsAsAResource || (watts >= (totalWatts + wattsConsideration))) {
@ -136,7 +136,7 @@ func (s *MaxGreedyMins) ConsumeOffers(spc SchedPolicyContext, driver sched.Sched
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration
log.Fatal(err)
elekLog.Fatal(err)
}
// Don't take offer if it doesn't match our task's host requirement
@ -161,7 +161,7 @@ func (s *MaxGreedyMins) ConsumeOffers(spc SchedPolicyContext, driver sched.Sched
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration
log.Fatal(err)
elekLog.Fatal(err)
}
// Don't take offer if it doesn't match our task's host requirement

View file

@ -19,7 +19,7 @@
package schedulers
import (
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
@ -39,7 +39,7 @@ func (s *MaxMin) takeOffer(spc SchedPolicyContext, offer *mesos.Offer, task def.
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration
log.Fatal(err)
elekLog.Fatal(err)
}
if (cpus >= (totalCPU + task.CPU)) && (mem >= (totalRAM + task.RAM)) &&
(!baseSchedRef.wattsAsAResource || (watts >= (totalWatts + wattsConsideration))) {
@ -148,7 +148,7 @@ func (s *MaxMin) ConsumeOffers(spc SchedPolicyContext, driver sched.SchedulerDri
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration.
log.Fatal(err)
elekLog.Fatal(err)
}
// Don't take offer if it doesn't match our task's host requirement.

View file

@ -28,7 +28,7 @@ import (
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"github.com/mesos/mesos-go/api/v0/mesosutil"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -67,7 +67,7 @@ type BaseScheduler struct {
// Controls when to shutdown pcp logging.
PCPLog chan struct{}
schedTrace *log.Logger
schedTrace *elekLog.Logger
mutex sync.Mutex
@ -102,7 +102,7 @@ func (s *BaseScheduler) init(opts ...SchedulerOptions) {
for _, opt := range opts {
// applying options
if err := opt(s); err != nil {
log.Fatal(err)
elekLog.Fatal(err)
}
}
s.TasksRunningMutex.Lock()
@ -251,12 +251,12 @@ func (s *BaseScheduler) StatusUpdate(driver sched.SchedulerDriver, status *mesos
func (s *BaseScheduler) LogTaskStarting(ts *def.Task, offer *mesos.Offer) {
lmt := elekLogTypes.GENERAL
if ts == nil {
elektronLogging.ElektronLog.Log(lmt, log.InfoLevel,
log.Fields{"host": fmt.Sprintf("%s", offer.GetHostname())}, "TASKS STARTING...")
elektronLogging.ElektronLog.Log(lmt, elekLog.InfoLevel,
elekLog.Fields{"host": fmt.Sprintf("%s", offer.GetHostname())}, "TASKS STARTING...")
} else {
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"task": fmt.Sprintf("%s", ts.Name),
elekLog.InfoLevel,
elekLog.Fields{"task": fmt.Sprintf("%s", ts.Name),
"Instance": fmt.Sprintf("%d", *ts.Instances), "host": fmt.Sprintf("%s", offer.GetHostname())},
"TASK STARTING... ")
}
@ -265,29 +265,29 @@ func (s *BaseScheduler) LogTaskStarting(ts *def.Task, offer *mesos.Offer) {
func (s *BaseScheduler) LogTaskWattsConsideration(ts def.Task, host string, wattsToConsider float64) {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"task": ts.Name, "host": host, "Watts": fmt.Sprintf("%f", wattsToConsider)}, "Watts considered for ")
elekLog.InfoLevel,
elekLog.Fields{"task": ts.Name, "host": host, "Watts": fmt.Sprintf("%f", wattsToConsider)}, "Watts considered for ")
}
func (s *BaseScheduler) LogOffersReceived(offers []*mesos.Offer) {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"Resource offers received": fmt.Sprintf("%d", len(offers))}, "")
elekLog.InfoLevel,
elekLog.Fields{"Resource offers received": fmt.Sprintf("%d", len(offers))}, "")
}
func (s *BaseScheduler) LogNoPendingTasksDeclineOffers(offer *mesos.Offer) {
lmt := elekLogTypes.WARNING
elektronLogging.ElektronLog.Log(lmt,
log.WarnLevel,
log.Fields{"DECLINING OFFER for host": fmt.Sprintf("%s", offer.GetHostname())}, "No tasks left to schedule ")
elekLog.WarnLevel,
elekLog.Fields{"DECLINING OFFER for host": fmt.Sprintf("%s", offer.GetHostname())}, "No tasks left to schedule ")
}
func (s *BaseScheduler) LogNumberOfRunningTasks() {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"Number of tasks still Running": fmt.Sprintf("%d", s.tasksRunning)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Number of tasks still Running": fmt.Sprintf("%d", s.tasksRunning)}, "")
}
func (s *BaseScheduler) LogCoLocatedTasks(slaveID string) {
@ -299,21 +299,21 @@ func (s *BaseScheduler) LogCoLocatedTasks(slaveID string) {
}
s.TasksRunningMutex.Unlock()
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"Colocated with": fmt.Sprintf("%s", buffer.String())}, "")
elekLog.InfoLevel,
elekLog.Fields{"Colocated with": fmt.Sprintf("%s", buffer.String())}, "")
}
func (s *BaseScheduler) LogSchedTrace(taskToSchedule *mesos.TaskInfo, offer *mesos.Offer) {
elektronLogging.ElektronLog.Log(elekLogTypes.SCHED_TRACE,
log.InfoLevel,
log.Fields{offer.GetHostname(): fmt.Sprintf("%s", taskToSchedule.GetTaskId().GetValue())}, "")
elekLog.InfoLevel,
elekLog.Fields{offer.GetHostname(): fmt.Sprintf("%s", taskToSchedule.GetTaskId().GetValue())}, "")
}
func (s *BaseScheduler) LogTerminateScheduler() {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{}, "Done scheduling all tasks!")
elekLog.InfoLevel,
elekLog.Fields{}, "Done scheduling all tasks!")
}
func (s *BaseScheduler) LogInsufficientResourcesDeclineOffer(offer *mesos.Offer,
@ -322,73 +322,73 @@ func (s *BaseScheduler) LogInsufficientResourcesDeclineOffer(offer *mesos.Offer,
buffer := bytes.Buffer{}
buffer.WriteString(fmt.Sprintf("<CPU: %f, RAM: %f, Watts: %f>", offerResources...))
elektronLogging.ElektronLog.Log(lmt,
log.WarnLevel,
log.Fields{"Offer Resources": fmt.Sprintf("%s", buffer.String())}, "DECLINING OFFER... Offer has insufficient resources to launch a task")
elekLog.WarnLevel,
elekLog.Fields{"Offer Resources": fmt.Sprintf("%s", buffer.String())}, "DECLINING OFFER... Offer has insufficient resources to launch a task")
}
func (s *BaseScheduler) LogOfferRescinded(offerID *mesos.OfferID) {
lmt := elekLogTypes.ERROR
elektronLogging.ElektronLog.Log(lmt,
log.ErrorLevel,
log.Fields{"OfferID": fmt.Sprintf("%s", offerID)}, "OFFER RESCINDED")
elekLog.ErrorLevel,
elekLog.Fields{"OfferID": fmt.Sprintf("%s", offerID)}, "OFFER RESCINDED")
}
func (s *BaseScheduler) LogSlaveLost(slaveID *mesos.SlaveID) {
lmt := elekLogTypes.ERROR
elektronLogging.ElektronLog.Log(lmt,
log.ErrorLevel,
log.Fields{"SlaveID": fmt.Sprintf("%s", slaveID)}, "SLAVE LOST")
elekLog.ErrorLevel,
elekLog.Fields{"SlaveID": fmt.Sprintf("%s", slaveID)}, "SLAVE LOST")
}
func (s *BaseScheduler) LogExecutorLost(executorID *mesos.ExecutorID, slaveID *mesos.SlaveID) {
lmt := elekLogTypes.ERROR
elektronLogging.ElektronLog.Log(lmt,
log.ErrorLevel,
log.Fields{"ExecutorID": fmt.Sprintf("%s", executorID), "SlaveID": fmt.Sprintf("%s", slaveID)}, "EXECUTOR LOST")
elekLog.ErrorLevel,
elekLog.Fields{"ExecutorID": fmt.Sprintf("%s", executorID), "SlaveID": fmt.Sprintf("%s", slaveID)}, "EXECUTOR LOST")
}
func (s *BaseScheduler) LogFrameworkMessage(executorID *mesos.ExecutorID,
slaveID *mesos.SlaveID, message string) {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"Received Framework message from executor": executorID}, message)
elekLog.InfoLevel,
elekLog.Fields{"Received Framework message from executor": executorID}, message)
}
func (s *BaseScheduler) LogMesosError(err string) {
lmt := elekLogTypes.ERROR
elektronLogging.ElektronLog.Log(lmt,
log.ErrorLevel,
log.Fields{"MESOS ERROR": fmt.Sprintf("%v", err)}, "")
elekLog.ErrorLevel,
elekLog.Fields{"MESOS ERROR": fmt.Sprintf("%v", err)}, "")
}
func (s *BaseScheduler) LogElectronError(err error) {
lmt := elekLogTypes.ERROR
elektronLogging.ElektronLog.Log(lmt,
log.ErrorLevel,
log.Fields{"ELECTRON ERROR": fmt.Sprintf("%v", err)}, "")
elekLog.ErrorLevel,
elekLog.Fields{"ELECTRON ERROR": fmt.Sprintf("%v", err)}, "")
}
func (s *BaseScheduler) LogFrameworkRegistered(frameworkID *mesos.FrameworkID,
masterInfo *mesos.MasterInfo) {
lmt := elekLogTypes.SUCCESS
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"frameworkID": fmt.Sprintf("%s", frameworkID), "master": fmt.Sprintf("%s", masterInfo)}, "FRAMEWORK REGISTERED!")
elekLog.InfoLevel,
elekLog.Fields{"frameworkID": fmt.Sprintf("%s", frameworkID), "master": fmt.Sprintf("%s", masterInfo)}, "FRAMEWORK REGISTERED!")
}
func (s *BaseScheduler) LogFrameworkReregistered(masterInfo *mesos.MasterInfo) {
lmt := elekLogTypes.GENERAL
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"master": fmt.Sprintf("%s", masterInfo)}, "Framework re-registered")
elekLog.InfoLevel,
elekLog.Fields{"master": fmt.Sprintf("%s", masterInfo)}, "Framework re-registered")
}
func (s *BaseScheduler) LogDisconnected() {
lmt := elekLogTypes.WARNING
elektronLogging.ElektronLog.Log(lmt,
log.WarnLevel,
log.Fields{}, "Framework disconnected with master")
elekLog.WarnLevel,
elekLog.Fields{}, "Framework disconnected with master")
}
func (s *BaseScheduler) LogTaskStatusUpdate(status *mesos.TaskStatus) {
@ -403,15 +403,15 @@ func (s *BaseScheduler) LogTaskStatusUpdate(status *mesos.TaskStatus) {
lmt = elekLogTypes.GENERAL
}
elektronLogging.ElektronLog.Log(lmt,
log.InfoLevel,
log.Fields{"task": fmt.Sprintf("%s", *status.TaskId.Value), "state": NameFor(status.State)}, "Task Status received")
elekLog.InfoLevel,
elekLog.Fields{"task": fmt.Sprintf("%s", *status.TaskId.Value), "state": NameFor(status.State)}, "Task Status received")
}
func (s *BaseScheduler) LogSchedPolicySwitch(name string, nextPolicy SchedPolicyState) {
logSPS := func() {
elektronLogging.ElektronLog.Log(elekLogTypes.SPS,
log.InfoLevel,
log.Fields{"Name": name}, "")
elekLog.InfoLevel,
elekLog.Fields{"Name": name}, "")
}
if s.hasReceivedResourceOffers && (s.curSchedPolicy != nextPolicy) {
logSPS()
@ -421,13 +421,13 @@ func (s *BaseScheduler) LogSchedPolicySwitch(name string, nextPolicy SchedPolicy
// Logging the size of the scheduling window and the scheduling policy
// that is going to schedule the tasks in the scheduling window.
elektronLogging.ElektronLog.Log(elekLogTypes.SCHED_WINDOW,
log.InfoLevel,
log.Fields{"Window size": fmt.Sprintf("%d", s.schedWindowSize), "Name": name}, "")
elekLog.InfoLevel,
elekLog.Fields{"Window size": fmt.Sprintf("%d", s.schedWindowSize), "Name": name}, "")
}
func (s *BaseScheduler) LogClsfnAndTaskDistOverhead(overhead time.Duration) {
// Logging the overhead in microseconds.
elektronLogging.ElektronLog.Log(elekLogTypes.CLSFN_TASKDIST_OVERHEAD,
log.InfoLevel,
log.Fields{"Overhead in microseconds": fmt.Sprintf("%f", float64(overhead.Nanoseconds())/1000.0)}, "")
elekLog.InfoLevel,
elekLog.Fields{"Overhead in microseconds": fmt.Sprintf("%f", float64(overhead.Nanoseconds())/1000.0)}, "")
}

View file

@ -19,7 +19,7 @@
package schedulers
import (
"log"
elekLog "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
@ -39,7 +39,7 @@ func (s *BinPackSortedWatts) takeOffer(spc SchedPolicyContext, offer *mesos.Offe
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration.
log.Fatal(err)
elekLog.Fatal(err)
}
if (cpus >= (totalCPU + task.CPU)) && (mem >= (totalRAM + task.RAM)) &&
(!baseSchedRef.wattsAsAResource || (watts >= (totalWatts + wattsConsideration))) {
@ -83,7 +83,7 @@ func (s *BinPackSortedWatts) ConsumeOffers(spc SchedPolicyContext, driver sched.
wattsConsideration, err := def.WattsToConsider(task, baseSchedRef.classMapWatts, offer)
if err != nil {
// Error in determining wattsConsideration.
log.Fatal(err)
elekLog.Fatal(err)
}
// Don't take offer if it doesn't match our task's host requirement.

View file

@ -23,7 +23,7 @@ import (
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/constants"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/elektronLogging"
@ -36,13 +36,13 @@ func coLocated(tasks map[string]bool, s BaseScheduler) {
for task := range tasks {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Task": task}, "")
elekLog.InfoLevel,
elekLog.Fields{"Task": task}, "")
}
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{}, "---------------------")
elekLog.InfoLevel,
elekLog.Fields{}, "---------------------")
}
// Get the powerClass of the given hostname.
@ -157,7 +157,7 @@ func WithSchedPolSwitchEnabled(enableSchedPolicySwitch bool, switchingCriteria s
func WithNameOfFirstSchedPolToFix(nameOfFirstSchedPol string) SchedulerOptions {
return func(s ElectronScheduler) error {
if nameOfFirstSchedPol == "" {
log.Println("First scheduling policy to deploy not mentioned. This is now" +
elekLog.Println("First scheduling policy to deploy not mentioned. This is now" +
" going to be determined at runtime.")
return nil
}
@ -175,7 +175,7 @@ func WithFixedSchedulingWindow(toFixSchedWindow bool, fixedSchedWindowSize int)
if fixedSchedWindowSize <= 0 {
return errors.New("Invalid value of scheduling window size. Please provide a value > 0.")
}
log.Println(fmt.Sprintf("Fixing the size of the scheduling window to %d.."+
elekLog.Println(fmt.Sprintf("Fixing the size of the scheduling window to %d.."+
".", fixedSchedWindowSize))
s.(*BaseScheduler).toFixSchedWindow = toFixSchedWindow
s.(*BaseScheduler).schedWindowSize = fixedSchedWindowSize

View file

@ -24,7 +24,7 @@ import (
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -91,8 +91,8 @@ func switchTaskDistBased(baseSchedRef *BaseScheduler) string {
taskDist, err := def.GetTaskDistributionInWindow(baseSchedRef.schedWindowSize, baseSchedRef.tasks)
baseSchedRef.LogClsfnAndTaskDistOverhead(time.Now().Sub(startTime))
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL,
log.InfoLevel,
log.Fields{"Task Distribution": fmt.Sprintf("%f", taskDist)}, "Switching... ")
elekLog.InfoLevel,
elekLog.Fields{"Task Distribution": fmt.Sprintf("%f", taskDist)}, "Switching... ")
if err != nil {
// All the tasks in the window were only classified into 1 cluster.
// Max-Min and Max-GreedyMins would work the same way as Bin-Packing for this situation.
@ -220,8 +220,8 @@ func (bsps *baseSchedPolicyState) SwitchIfNecessary(spc SchedPolicyContext) {
switchToPolicyName = switchBasedOn[baseSchedRef.schedPolSwitchCriteria](baseSchedRef)
} else {
// We continue working with the currently deployed scheduling policy.
log.Println("Continuing with the current scheduling policy...")
log.Printf("TasksScheduled[%d], SchedWindowSize[%d]", bsps.numTasksScheduled,
elekLog.Println("Continuing with the current scheduling policy...")
elekLog.Printf("TasksScheduled[%d], SchedWindowSize[%d]", bsps.numTasksScheduled,
baseSchedRef.schedWindowSize)
return
}
@ -234,8 +234,8 @@ func (bsps *baseSchedPolicyState) SwitchIfNecessary(spc SchedPolicyContext) {
bsps.numTasksScheduled = 0
} else {
// We continue working with the currently deployed scheduling policy.
log.Println("Continuing with the current scheduling policy...")
log.Printf("TasksScheduled[%d], SchedWindowSize[%d]", bsps.numTasksScheduled,
elekLog.Println("Continuing with the current scheduling policy...")
elekLog.Printf("TasksScheduled[%d], SchedWindowSize[%d]", bsps.numTasksScheduled,
baseSchedRef.schedWindowSize)
return
}

View file

@ -21,7 +21,7 @@ package offerUtils
import (
"fmt"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/constants"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -90,14 +90,14 @@ func UpdateEnvironment(offer *mesos.Offer) {
var host = offer.GetHostname()
// If this host is not present in the set of hosts.
if _, ok := constants.Hosts[host]; !ok {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, log.InfoLevel,
log.Fields{"Adding host": fmt.Sprintf("%s", host)}, "New host detected")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, elekLog.InfoLevel,
elekLog.Fields{"Adding host": fmt.Sprintf("%s", host)}, "New host detected")
// Add this host.
constants.Hosts[host] = struct{}{}
// Get the power class of this host.
class := PowerClass(offer)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, log.InfoLevel,
log.Fields{"host": fmt.Sprintf("%s", host), "PowerClass": fmt.Sprintf("%s", class)}, "Registering the power class...")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, elekLog.InfoLevel,
elekLog.Fields{"host": fmt.Sprintf("%s", host), "PowerClass": fmt.Sprintf("%s", class)}, "Registering the power class...")
// If new power class, register the power class.
if _, ok := constants.PowerClasses[class]; !ok {
constants.PowerClasses[class] = make(map[string]struct{})

View file

@ -20,7 +20,7 @@ package schedUtils
import (
"fmt"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -79,8 +79,8 @@ func (s *fillNextOfferCycle) apply(taskQueue []def.Task) (int, int) {
for _, task := range taskQueue {
numberOfTasksTraversed++
for i := *task.Instances; i > 0; i-- {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, log.InfoLevel,
log.Fields{}, fmt.Sprintf("Checking if Instance #%d of Task[%s] can be scheduled "+
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, elekLog.InfoLevel,
elekLog.Fields{}, fmt.Sprintf("Checking if Instance #%d of Task[%s] can be scheduled "+
"during the next offer cycle...", i, task.Name))
if canSchedule(task) {
filledCPU += task.CPU