func NewOverseer() *Overseer {
	once.Do(func() {
		if ml.NewLogger == nil {
			ml.SetupLogBuilder(func(name string) Logger {
				return &ml.DefaultLogger{Name: name}
			})
		}
		log = ml.NewLogger("overseer")
	})
	rand.Seed(time.Now().UTC().UnixNano())
	ovr := &Overseer{
		access:    &sync.RWMutex{},
		stateLock: &sync.RWMutex{},
	}
	sigChannel := make(chan os.Signal, 2)
	signal.Notify(sigChannel, syscall.SIGINT, syscall.SIGTERM)
	go func() {
		for sig := range sigChannel {
			log.Error("Received signal: %v!", Attrs{"sig": sig})
			ovr.StopAll(false)
		}
	}()
	return ovr
}
NewOverseer creates a new process manager.
After creating it, Add the procs and call SuperviseAll.
package overseer
import (
	"errors"
	"fmt"
	"math/rand"
	"os"
	"os/signal"
	"sort"
	"sync"
	"syscall"
	"time"
	ml "github.com/ShinyTrinkets/meta-logger"
)
const timeUnit = 100 * time.Millisecond
type (
	Attrs = ml.Attrs
	Logger = ml.Logger
)
type Overseer struct {
	access    *sync.RWMutex
	stateLock *sync.RWMutex
	procs     sync.Map  
	watchers  []chan *ProcessJSON
	loggers   []chan *LogMsg
	state     OvrState
}
type ProcessJSON struct {
	ID         string    `json:"id"`
	Group      string    `json:"group"`
	Cmd        string    `json:"cmd"`
	Dir        string    `json:"dir"`
	PID        int       `json:"PID"`
	State      string    `json:"state"`
	ExitCode   int       `json:"exitCode"`  
	Error      error     `json:"error"`     
	StartTime  time.Time `json:"startTime"`
	DelayStart uint      `json:"delayStart"`
	RetryTimes uint      `json:"retryTimes"`
}
type LogMsg struct {
	Type uint8
	Text string
}
var log ml.Logger
var once sync.Once
func SetupLogBuilder(b ml.LogBuilderType) {
	ml.SetupLogBuilder(b)
}