mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-19 21:55:27 +00:00
Enhancements to Revel command
Reformat of code Allow user to use a mix of command line arguments and flags Enhance the import tool to detect missing packages in the modules side Added test cases for all commands
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
Package logger contains filters and handles for the logging utilities in Revel.
|
||||
These facilities all currently use the logging library called log15 at
|
||||
@@ -7,5 +6,5 @@
|
||||
Wrappers for the handlers are written here to provide a kind of isolation layer for Revel
|
||||
in case sometime in the future we would like to switch to another source to implement logging
|
||||
|
||||
*/
|
||||
*/
|
||||
package logger
|
||||
|
||||
@@ -121,6 +121,7 @@ func SetDefaultLog(fromLog MultiLogger) {
|
||||
func (rl *RevelLogger) Debugf(msg string, param ...interface{}) {
|
||||
rl.Debug(fmt.Sprintf(msg, param...))
|
||||
}
|
||||
|
||||
// Formatted info call
|
||||
func (rl *RevelLogger) Infof(msg string, param ...interface{}) {
|
||||
rl.Info(fmt.Sprintf(msg, param...))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package logger
|
||||
|
||||
import (
|
||||
"gopkg.in/stack.v0"
|
||||
"github.com/revel/config"
|
||||
"github.com/revel/log15"
|
||||
"gopkg.in/stack.v0"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -43,15 +43,14 @@ func GetLogger(name string, logger MultiLogger) (l *log.Logger) {
|
||||
// Get all handlers based on the Config (if available)
|
||||
func InitializeFromConfig(basePath string, config *config.Context) (c *CompositeMultiHandler) {
|
||||
// If running in test mode suppress anything that is not an error
|
||||
if config!=nil && config.BoolDefault("testModeFlag",false) {
|
||||
config.SetOption("log.info.output","none")
|
||||
config.SetOption("log.debug.output","none")
|
||||
config.SetOption("log.warn.output","none")
|
||||
config.SetOption("log.error.output","stderr")
|
||||
config.SetOption("log.crit.output","stderr")
|
||||
if config != nil && config.BoolDefault("testModeFlag", false) {
|
||||
config.SetOption("log.info.output", "off")
|
||||
config.SetOption("log.debug.output", "off")
|
||||
config.SetOption("log.warn.output", "off")
|
||||
config.SetOption("log.error.output", "stderr")
|
||||
config.SetOption("log.crit.output", "stderr")
|
||||
}
|
||||
|
||||
|
||||
// If the configuration has an all option we can skip some
|
||||
c, _ = NewCompositeMultiHandler()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user