refactored logging/types imports to dot imports
This commit is contained in:
parent
6fb0e4a3fe
commit
3b70a13cc8
10 changed files with 82 additions and 82 deletions
|
@ -25,7 +25,7 @@ import (
|
|||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/constants"
|
||||
elekLog "github.com/spdfg/elektron/logging"
|
||||
elekLogTypes "github.com/spdfg/elektron/logging/types"
|
||||
. "github.com/spdfg/elektron/logging/types"
|
||||
)
|
||||
|
||||
func OfferAgg(offer *mesos.Offer) (float64, float64, float64) {
|
||||
|
@ -90,12 +90,12 @@ 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 {
|
||||
elekLog.WithFields(log.Fields{"Adding host": host}).Log(elekLogTypes.CONSOLE, log.InfoLevel, "New host detected")
|
||||
elekLog.WithFields(log.Fields{"Adding host": host}).Log(CONSOLE, log.InfoLevel, "New host detected")
|
||||
// Add this host.
|
||||
constants.Hosts[host] = struct{}{}
|
||||
// Get the power class of this host.
|
||||
class := PowerClass(offer)
|
||||
elekLog.WithFields(log.Fields{"host": host, "PowerClass": class}).Log(elekLogTypes.CONSOLE,
|
||||
elekLog.WithFields(log.Fields{"host": host, "PowerClass": class}).Log(CONSOLE,
|
||||
log.InfoLevel, "Registering the power class...")
|
||||
// If new power class, register the power class.
|
||||
if _, ok := constants.PowerClasses[class]; !ok {
|
||||
|
|
Reference in a new issue