github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/ui/logged.go (about)

     1  package ui
     2  
     3  import (
     4  	"log"
     5  )
     6  
     7  // Logged is an implementation of Ui that logs all messages as they
     8  // pass through.
     9  type Logged struct {
    10  	Ui Ui
    11  }
    12  
    13  func (l *Logged) Header(msg string) {
    14  	log.Printf("[INFO] ui header: %s", msg)
    15  	l.Ui.Header(msg)
    16  }
    17  
    18  func (l *Logged) Message(msg string) {
    19  	log.Printf("[INFO] ui message: %s", msg)
    20  	l.Ui.Message(msg)
    21  }
    22  
    23  func (l *Logged) Raw(msg string) {
    24  	log.Printf("[INFO] ui raw: %s", msg)
    25  	l.Ui.Raw(msg)
    26  }
    27  
    28  func (l *Logged) Input(opts *InputOpts) (string, error) {
    29  	// Not sure what to log here.
    30  	return l.Ui.Input(opts)
    31  }