func (c *Crew) Logf(format string, args ...interface{}) {
	if !c.Verbose {
		return
	}
	log.Printf(format, args...)
}
Logf logs if c.Verbose.
package sio
import (
	"context"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
	"sync"
	"github.com/Comcast/sheens/core"
	"github.com/Comcast/sheens/crew"
	"github.com/Comcast/sheens/interpreters/ecmascript"
	"github.com/Comcast/sheens/match"
	yaml "gopkg.in/yaml.v2"
)
var (
	interpreter = ecmascript.NewInterpreter()
	Interpreters = core.InterpretersMap{
		"goja":           interpreter,
		"ecmascript":     interpreter,
		"ecmascript-5.1": interpreter,
	}
)
type Changed struct {
	State   *core.State      `json:",omitempty"`
	SpecSrc *crew.SpecSource `json:",omitempty"`
	Deleted bool             `json:",omitempty"`
	PreviousState []byte `json:"-"`
}
type Result struct {
	Changed map[string]*Changed
	Emitted [][]interface{}
}
type Crew struct {
	Machines map[string]*crew.Machine
	Conf     *CrewConf `json:"conf"`
	Verbose bool
	changed  map[string]*Changed
	previous map[string]string
	timers   *Timers
	in  chan interface{}
	out chan *Result
	sync.Mutex
}
func NewCrew(ctx context.Context, conf *CrewConf, couplings Couplings) (*Crew, error) {
	in, out, err := couplings.IO(ctx)
	if err != nil {
		return nil, err
	}
	c := &Crew{
		Conf: conf,
		in:   in,
		out:  out,
	}
	return c, c.init(ctx)
}
func (c *Crew) init(ctx context.Context) error {
	c.Machines = make(map[string]*crew.Machine, 32)
	c.changed = make(map[string]*Changed, 8)
	c.previous = make(map[string]string, 8)
	f := func(ctx context.Context, te *TimerEntry) {
		c.in <- te.Msg
	}
	c.timers = NewTimers(f)
	c.timers.c = c
	if err := c.SetMachine(ctx, CaptainMachine, nil, nil); err != nil {
		return err
	}
	if err := c.SetMachine(ctx, TimersMachine, nil, nil); err != nil {
		return err
	}
	return nil
}
func (c *Crew) change(mid string) *Changed {
	ch, have := c.changed[mid]
	if !have {
		ch = &Changed{}
		c.changed[mid] = ch
	}
	return ch
}