phase2 / rig

Outrigger command line tool
MIT License
11 stars 8 forks source link

Logging system is eating some log entries #148

Closed grayside closed 6 years ago

grayside commented 6 years ago

Problem

When we use the Info, Error, or Warning methods on the logger and our Spinning lock is active, we send the message to the spinner. However, when one of those messages is sent to the spinner, one of the side effects is that the spinner is shut down (because we are issuing success/warning/error states pretty much all the time). This means we have an inactive spinner but our lock mechanism reports the spinner is active, and log entries sent to the spinner vanish.

For example, this has been eating the last couple lines of rig start:

[INFO] Run 'eval "$(rig config)"' to execute docker or docker-compose commands in your terminal.
[INFO] Outrigger is ready to use

I was able to get that to appear by running cmd.out.NoSpin() after the start.go spinner was done and I knew we were done with it.

However, per this code snippet from the middle of the start process:

cmd.out.Info("Docker Machine (%s) Created", cmd.machine.Name)
cmd.out.Verbose("Configuring the local Docker environment")
cmd.machine.SetEnv()
cmd.out.Info("Docker Machine is ready")

We have this "Docker Machine is ready" log entry that continues to be invisible.

Solution

Toggle our lock off after the spinner shutdown methods are used. Remove redundant calls to the NoSpin method.