github.com/wawandco/oxplugins@v0.7.11/tools/pop/migrate/logger.go (about)

     1  package migrate
     2  
     3  import (
     4  	"fmt"
     5  	"log"
     6  	"os"
     7  
     8  	"github.com/fatih/color"
     9  	"github.com/gobuffalo/pop/v5/logging"
    10  )
    11  
    12  type Logger struct{}
    13  
    14  func (l *Logger) Log(lvl logging.Level, s string, args ...interface{}) {
    15  	if lvl == logging.Debug {
    16  		return
    17  	}
    18  
    19  	if lvl == logging.SQL {
    20  		return
    21  	}
    22  
    23  	s = fmt.Sprintf(s, args...)
    24  	s = fmt.Sprintf("%s - %s", lvl, s)
    25  	s = color.YellowString(s)
    26  
    27  	log := log.New(os.Stdout, "[POP] ", log.LstdFlags)
    28  
    29  	log.Println(s)
    30  }