Skip to content

Commit 3cb94c7

Browse files
authored
Merge pull request #5 from mxpv/minor_fixes
A few minor fixes
2 parents cd39b22 + ab1fdb5 commit 3cb94c7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

machine.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const (
4242
)
4343

4444
// CPUTemplate defines a set of CPU features that are exposed by Firecracker
45-
type CPUTemplate models.CPUTemplate
45+
type CPUTemplate = models.CPUTemplate
4646

4747
// CPUTemplates known by Firecracker. These are passed through directly from the model.
4848
const (
@@ -89,12 +89,12 @@ type Machine struct {
8989
cfg Config
9090
client Firecracker
9191
cmd *exec.Cmd
92-
logger *log.Logger
92+
logger *log.Entry
9393
machineConfig models.MachineConfiguration // The actual machine config as reported by Firecracker
9494
}
9595

9696
// Logger returns a logrus logger appropriate for logging hypervisor messages
97-
func (m *Machine) Logger() *log.Logger {
97+
func (m *Machine) Logger() *log.Entry {
9898
// return m.logger.WithField("subsystem", "firecracker-go-sdk")
9999
return m.logger
100100
}
@@ -143,7 +143,7 @@ func NewMachine(cfg Config, opts ...Opt) *Machine {
143143
}
144144

145145
if m.logger == nil {
146-
m.logger = log.New()
146+
m.logger = log.NewEntry(log.New())
147147
}
148148

149149
if m.client == nil {

opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func WithClient(client Firecracker) Opt {
1212
}
1313
}
1414

15-
func WithLogger(logger *logrus.Logger) Opt {
15+
func WithLogger(logger *logrus.Entry) Opt {
1616
return func(machine *Machine) {
1717
machine.logger = logger
1818
}

0 commit comments

Comments
 (0)