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
|
||||
allowOnConsole: false
|
||||
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
|
||||
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
|
||||
filenameExtension: _schedWindow.log
|
||||
allowOnConsole: true
|
||||
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
|
||||
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
|
||||
filenameExtension: _classificationOverhead.log
|
||||
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
|
||||
|
||||
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)
|
||||
|
|
|
@ -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 {
|
||||
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)
|
||||
Logf(logType int, level log.Level, msgFmtString string, args ...interface{})
|
||||
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.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() {
|
||||
|
|
|
@ -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
|
||||
|
|
Inconsistent spacing.