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 114 additions and 105 deletions
Showing only changes of commit 0c0361e209 - Show all commits

View file

@ -52,7 +52,7 @@ 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 {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, 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
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, 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")
return []float64{0.0} // Won't reach here.
}
@ -108,7 +108,7 @@ func clusterSizeAvgMMMPU(tasks []Task, taskObservation func(task Task) []float64
pradykaushik commented 2019-11-21 00:31:57 +00:00 (Migrated from github.com)

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

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

Okay. Done

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

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

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

Okay. Done

Okay. Done
} else {
// skip this value
// there is an error in the task config.
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, 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
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, 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{}, err.Error())
}
} else {

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

@ -20,11 +20,12 @@ package def
import (
"fmt"
"reflect"
"testing"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"github.com/spdfg/elektron/constants"
"github.com/stretchr/testify/assert"
"reflect"
"testing"
)
func TestTasksFromJSON(t *testing.T) {

View file

@ -3,8 +3,9 @@ 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
"strings"
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
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
)
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

View file

@ -1,10 +1,11 @@
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!
"os"
"path/filepath"
"strings"
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!
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!
)
type ClsfnTaskDistrOverheadLogger struct {

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

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

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

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

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

Okay, will do the changes

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

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

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

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

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

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

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

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

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

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

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

Done

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

Done

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

Okay. Sure

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

Done

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

looks good now thanks!

looks good now thanks!
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,10 +1,11 @@
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
"os"
"path/filepath"
"strings"
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
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
)
type ConsoleLogger struct {

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,11 +1,12 @@
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
"os"
"strconv"
"strings"
"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
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
)
type logDirectory struct {
@ -19,8 +20,7 @@ func (logD *logDirectory) getDirName() string {
ridv commented 2019-11-19 03:50:51 +00:00 (Migrated from github.com)

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

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

Yeah, thats right

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

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

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

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

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

Done

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

Done

Done
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) {
if logD.name == "" {
// 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
// directory name format - 2019-November-21_14-33-0
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. Directory name format - 2019-November-21_14-33-0.
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())}, "")
logDirName = strings.Join([]string{logDirName, startTime.Month().String(), strconv.Itoa(startTime.Day())}, "-")
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
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,30 +1,32 @@
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`
. "github.com/spdfg/elektron/elektronLogging/types"
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`
"os"
"strings"
"time"
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`
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`
. "github.com/spdfg/elektron/elektronLogging/types"
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
var formatter ElektronFormatter
var ElektronLog *ConsoleLogger
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 ElektronLogger *ConsoleLogger
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 logDir logDirectory
func BuildLogger(prefix string, logConfigFilename string) {
// read configuration from yaml
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.
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`
config.GetConfig(logConfigFilename)
// 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 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`
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`
logDir.createLogDir(prefix, startTime)
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

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

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

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

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

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

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

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

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

Done

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

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

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

Done

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

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
// Instantiate the logrus instance.
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}, "_")
logger = &log.Logger{
Out: os.Stderr,
@ -32,8 +34,7 @@ func BuildLogger(prefix string, logConfigFilename 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`
Formatter: &formatter,
}
// create a chain of loggers
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

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

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

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

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

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

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

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

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

Done

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

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

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

Done

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

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
//head := &LoggerImpl{}
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 a chain of loggers.
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`
cLog := NewConsoleLogger(CONSOLE, prefix)
pLog := NewPCPLogger(PCP, prefix)
schedTraceLog := NewSchedTraceLogger(SCHED_TRACE, prefix)
@ -41,12 +42,11 @@ func BuildLogger(prefix string, logConfigFilename 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`
schedWindowLog := NewSchedWindowLogger(SCHED_WINDOW, prefix)
tskDistLog := NewClsfnTaskDistrOverheadLogger(CLSFN_TASKDIST_OVERHEAD, prefix)
//head.SetNext(cLog)
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`
cLog.SetNext(pLog)
pLog.SetNext(schedTraceLog)
schedTraceLog.SetNext(spsLog)
spsLog.SetNext(schedWindowLog)
schedWindowLog.SetNext(tskDistLog)
ElektronLog = cLog
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`
ElektronLogger = cLog
pradykaushik commented 2019-11-21 01:22:14 +00:00 (Migrated from github.com)

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

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

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

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

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

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

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

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

Done

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

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

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

Done

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

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`
}

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

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

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

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

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

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

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

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

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

Done

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

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

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

Done

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

Changed ElektronLog to ElektronLogger

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

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

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

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

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

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

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

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

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

Done

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

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

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

Done

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

Changed ElektronLog to ElektronLogger

Changed `ElektronLog` to `ElektronLogger`

View file

@ -1,10 +1,11 @@
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
"os"
"path/filepath"
"strings"
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
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
)
type PCPLogger struct {

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,10 +1,11 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
)
type SchedPolicySwitchLogger struct {

View file

@ -1,10 +1,11 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
)
type SchedTraceLogger struct {

View file

@ -1,10 +1,11 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
)
type SchedWindowLogger struct {

View file

@ -47,7 +47,7 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
scanner.Scan()
// Write to logfile
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
@ -60,7 +60,7 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
text := scanner.Text()
if *logging {
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, text)
}
@ -69,7 +69,7 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
}
}(logging)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "PCP logging started")
@ -81,7 +81,7 @@ func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
select {
case <-quit:
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)

View file

@ -43,7 +43,7 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
if hiThreshold < loThreshold {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "High threshold is lower than low threshold!")
}
@ -61,7 +61,7 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
scanner.Scan()
// Write to logfile
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
@ -99,14 +99,14 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
if *logging {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Logging PCP...")
text := scanner.Text()
split := strings.Split(text, ",")
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, text)
@ -119,7 +119,7 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
powerHistories[host].Value = power
powerHistories[host] = powerHistories[host].Next()
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
"")
@ -133,14 +133,14 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
clusterMean := pcp.AverageClusterPowerHistory(clusterPowerHist)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
"Sec Avg": fmt.Sprintf("%f", clusterMean)},
"")
if clusterMean > hiThreshold {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Need to cap a node")
// Create statics for all victims and choose one to cap
@ -163,12 +163,12 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
if !cappedHosts[victim.Host] {
cappedHosts[victim.Host] = true
orderCapped = append(orderCapped, victim.Host)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.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 {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{}, "Error capping host")
}
@ -184,11 +184,11 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
cappedHosts[host] = false
// User RAPL package to send uncap.
log.Printf("Uncapping host %s", host)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Uncapped host": host}, "")
if err := rapl.Cap(host, "rapl", 100); err != nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{}, "Error capping host")
}
@ -200,7 +200,7 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
}
}(logging, hiThreshold, loThreshold)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "PCP logging started")
@ -212,7 +212,7 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
select {
case <-quit:
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)

View file

@ -56,7 +56,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
if hiThreshold < loThreshold {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "High threshold is lower than low threshold!")
}
@ -74,7 +74,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
scanner.Scan()
// Write to logfile
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
@ -115,13 +115,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
for scanner.Scan() {
if *logging {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Logging PCP...")
split := strings.Split(scanner.Text(), ",")
text := scanner.Text()
elekLog.ElektronLog.Log(elekLogTypes.PCP,
elekLog.ElektronLogger.Log(elekLogTypes.PCP,
log.InfoLevel,
log.Fields{}, text)
@ -134,7 +134,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
powerHistories[host].Value = power
powerHistories[host] = powerHistories[host].Next()
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Host": fmt.Sprintf("%s", indexToHost[powerIndex]), "Power": fmt.Sprintf("%f", (power * pcp.RAPLUnits))},
"")
@ -147,22 +147,22 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
clusterMean := pcp.AverageClusterPowerHistory(clusterPowerHist)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Total power": fmt.Sprintf("%f %d", clusterPower, clusterPowerHist.Len()),
"Sec Avg": fmt.Sprintf("%f", clusterMean)},
"")
if clusterMean >= hiThreshold {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Need to cap a node")
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
// Create statics for all victims and choose one to cap
@ -192,12 +192,12 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
// Need to cap this victim.
if err := rapl.Cap(victims[i].Host, "rapl", 50.0); err != nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"Error capping host": fmt.Sprintf("%s", victims[i].Host)}, "")
} else {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, fmt.Sprintf("Capped host[%s] at %f", victims[i].Host, 50.0))
// Keeping track of this victim and it's cap value
@ -223,12 +223,12 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
newCapValue := getNextCapValue(capValue, 2)
if err := rapl.Cap(alreadyCappedHosts[i], "rapl", newCapValue); err != nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"Error capping host": fmt.Sprintf("%s", alreadyCappedHosts[i])}, "")
} else {
// Successful cap
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, fmt.Sprintf("Capped host[%s] at %f", alreadyCappedHosts[i], newCapValue))
// Checking whether this victim can be capped further
@ -253,7 +253,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}
}
if !canCapAlreadyCappedVictim {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "No Victim left to cap")
}
@ -261,13 +261,13 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
} else if clusterMean < loThreshold {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Need to uncap a node")
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Cap values of capped victims": fmt.Sprintf("%v", cappedVictims)}, "")
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Cap values of victims to uncap": fmt.Sprintf("%v", orderCappedVictims)}, "")
if len(orderCapped) > 0 {
@ -280,12 +280,12 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
newUncapValue := orderCappedVictims[hostToUncap] * 2.0
if err := rapl.Cap(hostToUncap, "rapl", newUncapValue); err != nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"Error uncapping host": fmt.Sprintf("%s", hostToUncap)}, "")
} else {
// Successful uncap
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.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
@ -308,7 +308,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}
}
} else {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "No host staged for Uncapped")
}
@ -319,7 +319,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
}(logging, hiThreshold, loThreshold)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "PCP logging started")
if err := cmd.Start(); err != nil {
@ -330,7 +330,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
select {
case <-quit:
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)

View file

@ -21,11 +21,11 @@ package rapl
import (
"os"
"strconv"
"strings"
"github.com/pkg/errors"
elekEnv "github.com/spdfg/elektron/environment"
"golang.org/x/crypto/ssh"
"strings"
)
func Cap(host, username string, percentage float64) error {

View file

@ -21,6 +21,11 @@ package main // import github.com/spdfg/elektron
import (
"flag"
"fmt"
"os"
"os/signal"
"strings"
"time"
"github.com/golang/protobuf/proto"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
@ -31,10 +36,6 @@ import (
"github.com/spdfg/elektron/pcp"
"github.com/spdfg/elektron/powerCap"
"github.com/spdfg/elektron/schedulers"
"os"
"os/signal"
"strings"
"time"
)
var master = flag.String("master", "", "Location of leading Mesos master -- <mesos-master>:<port>")
@ -225,6 +226,7 @@ func main() {
if strings.Contains(*pcplogPrefix, "/") {
log.Fatal("log file prefix should not contain '/'.")
}
// Build Logger for elektron.
elekLog.BuildLogger(*pcplogPrefix, *logConfigFilename)
// Starting PCP logging.
@ -280,11 +282,11 @@ func main() {
// Starting the scheduler driver.
if status, err := driver.Run(); err != nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"status": status.String(), "error": err.Error()}, "Framework stopped ")
}
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{}, "Exiting...")
}

View file

@ -19,10 +19,9 @@
package schedulers
import (
log "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/utilities/mesosUtils"
"github.com/spdfg/elektron/utilities/offerUtils"

View file

@ -19,10 +19,9 @@
package schedulers
import (
log "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/utilities/mesosUtils"
"github.com/spdfg/elektron/utilities/offerUtils"

View file

@ -250,10 +250,10 @@ func (s *BaseScheduler) StatusUpdate(driver sched.SchedulerDriver, status *mesos
func (s *BaseScheduler) LogTaskStarting(ts *def.Task, offer *mesos.Offer) {
if ts == nil {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel,
log.Fields{"host": fmt.Sprintf("%s", offer.GetHostname())}, "TASKS STARTING...")
} else {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"task": fmt.Sprintf("%s", ts.Name),
"Instance": fmt.Sprintf("%d", *ts.Instances), "host": fmt.Sprintf("%s", offer.GetHostname())},
@ -262,25 +262,25 @@ func (s *BaseScheduler) LogTaskStarting(ts *def.Task, offer *mesos.Offer) {
}
func (s *BaseScheduler) LogTaskWattsConsideration(ts def.Task, host string, wattsToConsider float64) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"task": ts.Name, "host": host, "Watts": fmt.Sprintf("%f", wattsToConsider)}, "Watts considered for ")
}
func (s *BaseScheduler) LogOffersReceived(offers []*mesos.Offer) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Resource offers received": fmt.Sprintf("%d", len(offers))}, "")
}
func (s *BaseScheduler) LogNoPendingTasksDeclineOffers(offer *mesos.Offer) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.WarnLevel,
log.Fields{"DECLINING OFFER for host": fmt.Sprintf("%s", offer.GetHostname())}, "No tasks left to schedule ")
}
func (s *BaseScheduler) LogNumberOfRunningTasks() {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Number of tasks still Running": fmt.Sprintf("%d", s.tasksRunning)}, "")
}
@ -292,81 +292,81 @@ func (s *BaseScheduler) LogCoLocatedTasks(slaveID string) {
buffer.WriteString(fmt.Sprintln(taskName))
}
s.TasksRunningMutex.Unlock()
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Colocated with": fmt.Sprintf("%s", buffer.String())}, "")
}
func (s *BaseScheduler) LogSchedTrace(taskToSchedule *mesos.TaskInfo, offer *mesos.Offer) {
elekLog.ElektronLog.Log(elekLogTypes.SCHED_TRACE,
elekLog.ElektronLogger.Log(elekLogTypes.SCHED_TRACE,
log.InfoLevel,
log.Fields{offer.GetHostname(): fmt.Sprintf("%s", taskToSchedule.GetTaskId().GetValue())}, "")
}
func (s *BaseScheduler) LogTerminateScheduler() {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{}, "Done scheduling all tasks!")
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{}, "Done scheduling all tasks!")
}
func (s *BaseScheduler) LogInsufficientResourcesDeclineOffer(offer *mesos.Offer,
offerResources ...interface{}) {
buffer := bytes.Buffer{}
buffer.WriteString(fmt.Sprintf("<CPU: %f, RAM: %f, Watts: %f>", offerResources...))
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.WarnLevel,
log.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) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"OfferID": fmt.Sprintf("%s", offerID)}, "OFFER RESCINDED")
}
func (s *BaseScheduler) LogSlaveLost(slaveID *mesos.SlaveID) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"SlaveID": fmt.Sprintf("%s", slaveID)}, "SLAVE LOST")
}
func (s *BaseScheduler) LogExecutorLost(executorID *mesos.ExecutorID, slaveID *mesos.SlaveID) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.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) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Received Framework message from executor": executorID}, message)
}
func (s *BaseScheduler) LogMesosError(err string) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel,
log.Fields{"MESOS CONSOLE": fmt.Sprintf("%v", err)}, "")
}
func (s *BaseScheduler) LogElectronError(err error) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.ErrorLevel, log.Fields{"ELECTRON CONSOLE": fmt.Sprintf("%v", err)}, "")
}
func (s *BaseScheduler) LogFrameworkRegistered(frameworkID *mesos.FrameworkID,
masterInfo *mesos.MasterInfo) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"frameworkID": fmt.Sprintf("%s", frameworkID), "master": fmt.Sprintf("%v", masterInfo)}, "FRAMEWORK REGISTERED!")
}
func (s *BaseScheduler) LogFrameworkReregistered(masterInfo *mesos.MasterInfo) {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"master": fmt.Sprintf("%v", masterInfo)}, "Framework re-registered")
}
func (s *BaseScheduler) LogDisconnected() {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.WarnLevel, log.Fields{}, "Framework disconnected with master")
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.WarnLevel, log.Fields{}, "Framework disconnected with master")
}
func (s *BaseScheduler) LogTaskStatusUpdate(status *mesos.TaskStatus) {
@ -378,13 +378,13 @@ func (s *BaseScheduler) LogTaskStatusUpdate(status *mesos.TaskStatus) {
default:
level = log.InfoLevel
}
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
level, log.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() {
elekLog.ElektronLog.Log(elekLogTypes.SPS, log.InfoLevel, log.Fields{"Name": name}, "")
elekLog.ElektronLogger.Log(elekLogTypes.SPS, log.InfoLevel, log.Fields{"Name": name}, "")
}
if s.hasReceivedResourceOffers && (s.curSchedPolicy != nextPolicy) {
logSPS()
@ -393,14 +393,14 @@ 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.
elekLog.ElektronLog.Log(elekLogTypes.SCHED_WINDOW,
elekLog.ElektronLogger.Log(elekLogTypes.SCHED_WINDOW,
log.InfoLevel,
log.Fields{"Window size": fmt.Sprintf("%d", s.schedWindowSize), "Name": name}, "")
}
func (s *BaseScheduler) LogClsfnAndTaskDistOverhead(overhead time.Duration) {
// Logging the overhead in microseconds.
elekLog.ElektronLog.Log(elekLogTypes.CLSFN_TASKDIST_OVERHEAD,
elekLog.ElektronLogger.Log(elekLogTypes.CLSFN_TASKDIST_OVERHEAD,
log.InfoLevel,
log.Fields{"Overhead in microseconds": fmt.Sprintf("%f", float64(overhead.Nanoseconds())/1000.0)}, "")
}

View file

@ -19,10 +19,9 @@
package schedulers
import (
log "github.com/sirupsen/logrus"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
log "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/def"
"github.com/spdfg/elektron/utilities/mesosUtils"
"github.com/spdfg/elektron/utilities/offerUtils"

View file

@ -20,6 +20,7 @@ package schedulers
import (
"fmt"
pradykaushik commented 2019-11-21 22:32:31 +00:00 (Migrated from github.com)

Here, task would be the index.

    for _, task := range tasks {
        // rest of the code.
    }
Here, `task` would be the index. ```go for _, task := range tasks { // rest of the code. } ```
balandi1 commented 2019-11-26 18:34:17 +00:00 (Migrated from github.com)

Okay

Okay
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
@ -35,10 +36,10 @@ import (
func coLocated(tasks map[string]bool, s BaseScheduler) {
for _, task := range tasks {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{"Task": task}, "")
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{"Task": task}, "")
}
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{}, "---------------------")
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel, log.Fields{}, "---------------------")
}
// Get the powerClass of the given hostname.

View file

@ -90,7 +90,7 @@ func switchTaskDistBased(baseSchedRef *BaseScheduler) string {
// Determine the distribution of tasks in the new scheduling window.
taskDist, err := def.GetTaskDistributionInWindow(baseSchedRef.schedWindowSize, baseSchedRef.tasks)
baseSchedRef.LogClsfnAndTaskDistOverhead(time.Now().Sub(startTime))
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE,
log.InfoLevel,
log.Fields{"Task Distribution": fmt.Sprintf("%f", taskDist)}, "Switching... ")
if err != nil {

View file

@ -90,13 +90,13 @@ 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 {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel,
log.Fields{"Adding host": host}, "New host detected")
// Add this host.
constants.Hosts[host] = struct{}{}
// Get the power class of this host.
class := PowerClass(offer)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel,
log.Fields{"host": host, "PowerClass": class}, "Registering the power class...")
// If new power class, register the power class.
if _, ok := constants.PowerClasses[class]; !ok {

View file

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