WIP : Elektron Logging library #16
|
@ -40,8 +40,7 @@ func (f ElektronFormatter) Format(entry *log.Entry) ([]byte, error) {
|
|||
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
|
||||
|
||||
var formattedFields []string
|
||||
for key, value := range entry.Data {
|
||||
formattedFields = append(formattedFields,
|
||||
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
|
||||
strings.Join([]string{key, value.(string)}, "="))
|
||||
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
|
||||
formattedFields = append(formattedFields, strings.Join([]string{key, value.(string)}, "="))
|
||||
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
|
||||
}
|
||||
|
||||
b.WriteString(message)
|
||||
|
|
|||
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
![]() Formatting Formatting
![]() Formatting Formatting
![]() 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.
![]() 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.
![]() Okay. Sure Okay. Sure
![]() 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 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) `
![]() Done Done
![]() Done Done
![]() 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.
![]() 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.
![]() 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.
![]() Okay Okay
|
|
@ -12,17 +12,17 @@ console:
|
|||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
minLogLevel: debug
|
||||
allowOnConsole: true
|
||||
pcp:
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: .pcplog
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: false
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: .pcplog
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: false
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
schedWindow:
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: _schedWindow.log
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: _schedWindow.log
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
clsfnTaskDistrOverhead:
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: _classificationOverhead.log
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
enabled: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
filenameExtension: _classificationOverhead.log
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
allowOnConsole: true
|
||||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
||||
|
||||
|
||||
format:
|
||||
|
|
|||
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
![]() Inconsistent spacing. Inconsistent spacing.
![]() unnecessary comment. unnecessary comment.
![]() Done Done
![]() Removed Removed
![]() disable schedWindow logging in the log config file that is kept within the repository. disable schedWindow logging in the log config file that is kept within the repository.
![]() ditto ditto
![]() Done Done
![]() Done Done
|
|
@ -134,14 +134,6 @@ func WithPCPLog(pcpLog chan struct{}) SchedulerOptions {
|
|||
}
|
||||
}
|
||||
|
||||
/*func WithLoggingChannels(lmt chan elekLogDef.LogMessageType, msg chan string) SchedulerOptions {
|
||||
return func(s ElectronScheduler) error {
|
||||
s.(*BaseScheduler).logMsgType = lmt
|
||||
s.(*BaseScheduler).logMsg = msg
|
||||
return nil
|
||||
}
|
||||
}*/
|
||||
|
||||
func WithSchedPolSwitchEnabled(enableSchedPolicySwitch bool, switchingCriteria string) SchedulerOptions {
|
||||
return func(s ElectronScheduler) error {
|
||||
s.(*BaseScheduler).schedPolSwitchEnabled = enableSchedPolicySwitch
|
||||
|
|
Formatting
Formatting
Use strings.join instead. You should create the slice and append the message if necessary.
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.