Renamed alias log to elekLog

This commit is contained in:
balandi1 2019-11-21 14:02:47 -05:00
parent 7996240b2e
commit 9952b9861d
24 changed files with 254 additions and 254 deletions

View file

@ -21,7 +21,7 @@ package offerUtils
import (
"fmt"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
log "github.com/sirupsen/logrus"
elekLog "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/constants"
"github.com/spdfg/elektron/elektronLogging"
elekLogTypes "github.com/spdfg/elektron/elektronLogging/types"
@ -90,14 +90,14 @@ 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 {
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, log.InfoLevel,
log.Fields{"Adding host": fmt.Sprintf("%s", host)}, "New host detected")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, elekLog.InfoLevel,
elekLog.Fields{"Adding host": fmt.Sprintf("%s", host)}, "New host detected")
// Add this host.
constants.Hosts[host] = struct{}{}
// Get the power class of this host.
class := PowerClass(offer)
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, log.InfoLevel,
log.Fields{"host": fmt.Sprintf("%s", host), "PowerClass": fmt.Sprintf("%s", class)}, "Registering the power class...")
elektronLogging.ElektronLog.Log(elekLogTypes.GENERAL, elekLog.InfoLevel,
elekLog.Fields{"host": fmt.Sprintf("%s", host), "PowerClass": fmt.Sprintf("%s", class)}, "Registering the power class...")
// If new power class, register the power class.
if _, ok := constants.PowerClasses[class]; !ok {
constants.PowerClasses[class] = make(map[string]struct{})

View file

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