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:
NotZippy
2018-09-27 21:08:40 -07:00
parent 01ccd695d4
commit f4fb2ec091
65 changed files with 2014 additions and 1281 deletions

View File

@@ -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()