mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +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,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