WIP : Elektron Logging library #16

Merged
balandi1 merged 50 commits from master into master 2019-12-10 01:15:34 +00:00
5 changed files with 6 additions and 11 deletions
Showing only changes of commit 027adef642 - Show all commits

View file

@ -16,11 +16,11 @@ pcp:
pradykaushik commented 2019-11-21 02:59:07 +00:00 (Migrated from github.com)

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

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

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done
filenameExtension: .pcplog
allowOnConsole: false
schedWindow:
enabled: true
pradykaushik commented 2019-11-21 02:59:07 +00:00 (Migrated from github.com)

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done
enabled: false
pradykaushik commented 2019-11-21 02:59:07 +00:00 (Migrated from github.com)

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done
filenameExtension: _schedWindow.log
allowOnConsole: true
clsfnTaskDistrOverhead:
enabled: true
pradykaushik commented 2019-11-21 02:59:07 +00:00 (Migrated from github.com)

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done
enabled: false
pradykaushik commented 2019-11-21 02:59:07 +00:00 (Migrated from github.com)

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done
filenameExtension: _classificationOverhead.log
allowOnConsole: true

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

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

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

Inconsistent spacing.

Inconsistent spacing.
pradykaushik commented 2019-11-21 02:59:18 +00:00 (Migrated from github.com)

unnecessary comment.

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

Done

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

Removed

Removed
pradykaushik commented 2019-12-06 22:00:44 +00:00 (Migrated from github.com)

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.
pradykaushik commented 2019-12-06 22:00:51 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:37:11 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:37:36 +00:00 (Migrated from github.com)

Done

Done

View file

@ -1,11 +1,11 @@
package logging
import (
"fmt"
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
)
type consoleLogger struct {
@ -88,7 +88,6 @@ func (cLog *consoleLogger) createLogFile(prefix string) {
if cLog.isEnabled() {
filename := strings.Join([]string{prefix, cLog.getFilenameExtension()}, "")
dirName := cLog.logDir.getDirName()
fmt.Println(dirName)
if dirName != "" {
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
log.Fatal("Unable to create logFile: ", err)

View file

@ -16,9 +16,6 @@ var elektronLoggerInstance elektronLogger
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
type elektronLogger interface {
setNext(next elektronLogger)
isEnabled() bool
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
isAllowedOnConsole() bool
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
getFilenameExtension() string
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
Log(logType int, level log.Level, message string)
Logf(logType int, level log.Level, msgFmtString string, args ...interface{})
WithFields(logData log.Fields) elektronLogger

pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done
pradykaushik commented 2019-12-06 22:03:56 +00:00 (Migrated from github.com)

isEnabled() does not have to be part of the interface.

`isEnabled()` does not have to be part of the interface.
pradykaushik commented 2019-12-06 22:04:02 +00:00 (Migrated from github.com)

ditto

ditto
pradykaushik commented 2019-12-06 22:04:11 +00:00 (Migrated from github.com)

ditto

ditto
balandi1 commented 2019-12-09 15:41:29 +00:00 (Migrated from github.com)

Yes. Removed it from there

Yes. Removed it from there
balandi1 commented 2019-12-09 15:42:13 +00:00 (Migrated from github.com)

Done

Done
balandi1 commented 2019-12-09 15:42:23 +00:00 (Migrated from github.com)

Done

Done

View file

@ -78,7 +78,7 @@ func init() {
flag.BoolVar(fixSchedWindow, "fixSw", false, "Fix the size of the scheduling window that every deployed scheduling policy should schedule, provided switching is enabled (shorthand).")
flag.IntVar(schedWindowSize, "swSize", 200, "Size of the scheduling window if fixSchedWindow is set (shorthand).")
flag.StringVar(schedPolSwitchCriteria, "spsCriteria", "taskDist", "Scheduling policy switching criteria (shorthand).")
flag.StringVar(logConfigFilename, "lgConfigName", "logConfig.yaml", "Log Configuration file name (shorthand).")
flag.StringVar(logConfigFilename, "lgCfg", "logConfig.yaml", "Log Configuration file name (shorthand).")
}
func listAllSchedulingPolicies() {

View file

@ -79,8 +79,7 @@ func (s *fillNextOfferCycle) apply(taskQueue []def.Task) (int, int) {
numberOfTasksTraversed++
for i := *task.Instances; i > 0; i-- {
elekLog.Logf(CONSOLE, log.InfoLevel,
"Checking if Instance #%d of Task[%s] can be scheduled "+
"during the next offer cycle...", i, task.Name)
"Checking if Instance #%d of Task[%s] can be scheduled "+"during the next offer cycle...", i, task.Name)
if canSchedule(task) {
filledCPU += task.CPU
filledRAM += task.RAM