WIP : Elektron Logging library #16
|
@ -16,11 +16,11 @@ pcp:
|
||||||
![]() 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
|
|||||||
filenameExtension: .pcplog
|
filenameExtension: .pcplog
|
||||||
allowOnConsole: false
|
allowOnConsole: false
|
||||||
schedWindow:
|
schedWindow:
|
||||||
enabled: true
|
enabled: 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
![]() 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
|
filenameExtension: _schedWindow.log
|
||||||
allowOnConsole: true
|
allowOnConsole: true
|
||||||
clsfnTaskDistrOverhead:
|
clsfnTaskDistrOverhead:
|
||||||
enabled: true
|
enabled: 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
![]() 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
|
filenameExtension: _classificationOverhead.log
|
||||||
allowOnConsole: true
|
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
![]() 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
|
|
@ -1,11 +1,11 @@
|
||||||
package logging
|
package logging
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type consoleLogger struct {
|
type consoleLogger struct {
|
||||||
|
@ -88,7 +88,6 @@ func (cLog *consoleLogger) createLogFile(prefix string) {
|
||||||
if cLog.isEnabled() {
|
if cLog.isEnabled() {
|
||||||
filename := strings.Join([]string{prefix, cLog.getFilenameExtension()}, "")
|
filename := strings.Join([]string{prefix, cLog.getFilenameExtension()}, "")
|
||||||
dirName := cLog.logDir.getDirName()
|
dirName := cLog.logDir.getDirName()
|
||||||
fmt.Println(dirName)
|
|
||||||
if dirName != "" {
|
if dirName != "" {
|
||||||
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
if logFile, err := os.Create(filepath.Join(dirName, filename)); err != nil {
|
||||||
log.Fatal("Unable to create logFile: ", err)
|
log.Fatal("Unable to create logFile: ", err)
|
||||||
|
|
|
@ -16,9 +16,6 @@ var elektronLoggerInstance elektronLogger
|
||||||
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
|
|||||||
|
|
||||||
type elektronLogger interface {
|
type elektronLogger interface {
|
||||||
setNext(next elektronLogger)
|
setNext(next elektronLogger)
|
||||||
isEnabled() bool
|
|
||||||
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
|
|||||||
isAllowedOnConsole() bool
|
|
||||||
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
|
|||||||
getFilenameExtension() string
|
|
||||||
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
|
|||||||
Log(logType int, level log.Level, message string)
|
Log(logType int, level log.Level, message string)
|
||||||
Logf(logType int, level log.Level, msgFmtString string, args ...interface{})
|
Logf(logType int, level log.Level, msgFmtString string, args ...interface{})
|
||||||
WithFields(logData log.Fields) elektronLogger
|
WithFields(logData log.Fields) elektronLogger
|
||||||
|
|
||||||
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
![]()
`isEnabled()` does not have to be part of the interface.
![]() ditto ditto
![]() ditto ditto
![]() Yes. Removed it from there Yes. Removed it from there
![]() Done Done
![]() Done Done
|
|
@ -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.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.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(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() {
|
func listAllSchedulingPolicies() {
|
||||||
|
|
|
@ -79,8 +79,7 @@ func (s *fillNextOfferCycle) apply(taskQueue []def.Task) (int, int) {
|
||||||
numberOfTasksTraversed++
|
numberOfTasksTraversed++
|
||||||
for i := *task.Instances; i > 0; i-- {
|
for i := *task.Instances; i > 0; i-- {
|
||||||
elekLog.Logf(CONSOLE, log.InfoLevel,
|
elekLog.Logf(CONSOLE, log.InfoLevel,
|
||||||
"Checking if Instance #%d of Task[%s] can be scheduled "+
|
"Checking if Instance #%d of Task[%s] can be scheduled "+"during the next offer cycle...", i, task.Name)
|
||||||
"during the next offer cycle...", i, task.Name)
|
|
||||||
if canSchedule(task) {
|
if canSchedule(task) {
|
||||||
filledCPU += task.CPU
|
filledCPU += task.CPU
|
||||||
filledRAM += task.RAM
|
filledRAM += task.RAM
|
||||||
|
|
Inconsistent spacing.