code: func (n *Notifier) NotifyWatcherState(name string, detail machine.WatcherStateNotification) error {
  	j, err := detail.JSON()
  	if err != nil {
  		n.logger.Errorf("Could not json marshal watcher state: %v: %s", detail, err)
  		return err
  	}
  
  	n.logger.Infof(detail.String())
  
  	err = n.fw.PublishRaw("choria.machine.watcher.state", j)
  	if err != nil {
  		return errors.Wrap(err, "could not publish notification")
  	}
  
  	return nil
  }
docs: // NotifyWatcherState implements machine.NotificationService