func (u *Unit) Status() unit.Status {
	st := unit.Status{
		Load: unit.LoadStatus{
			Path:   u.Path(),
			Loaded: u.Loaded(),
			State:  -1, // TODO
		},
		Activation: unit.ActivationStatus{
			State: u.Active(),
			Sub:   u.Sub(),
		},
	}

	var err error
	if st.Log, err = ioutil.ReadAll(u.Log); err != nil {
		u.Log.Errorf("Error reading log: %s", err)
	}

	// TODO deal with different unit types requiring different status
	// something like u.Interface.HasX() ?
	switch u.Interface.(type) {
	//case *unit.Service:
	//return unit.ServiceStatus{st}
	default:
		return st
	}
}
// Status returns status of the unit
Status returns status of the unit
// Status returns status of the unit
func (u *Unit) Status() unit.Status {
	st := unit.Status{
		Load: unit.LoadStatus{
			Path:   u.Path(),
			Loaded: u.Loaded(),
			State:  -1, 
		},
		Activation: unit.ActivationStatus{
			State: u.Active(),
			Sub:   u.Sub(),
		},
	}
	var err error
	if st.Log, err = ioutil.ReadAll(u.Log); err != nil {
		u.Log.Errorf("Error reading log: %s", err)
	}
	 deal with different unit types requiring different status
	switch u.Interface.(type) {
	default:
		return st
	}
}
func ( u * Unit ) Status ( ) unit . Status { st := unit . Status { Load : unit . LoadStatus { Path : u . Path ( ) , Loaded : u . Loaded ( ) , State : - 1 , } , Activation : unit . ActivationStatus { State : u . Active ( ) , Sub : u . Sub ( ) , } , } var err error if st . Log , err = ioutil . ReadAll ( u . Log ) ; err != nil { u . Log . Errorf ( " " , err ) } switch u . Interface . ( type ) { default : return st } }
Status returns status of the unit
Status returns status of the unit
// TODO // TODO deal with different unit types requiring different status // something like u.Interface.HasX() ? //case *unit.Service: //return unit.ServiceStatus{st}