mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-24 07:45:28 +00:00
More linting
This commit is contained in:
@@ -39,8 +39,11 @@ func (h *CompositeMultiHandler) Log(r *Record) (err error) {
|
||||
|
||||
// Embed the caller function in the context
|
||||
if handler != nil {
|
||||
handler.Log(r)
|
||||
if err := handler.Log(r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -91,8 +94,8 @@ func (h *CompositeMultiHandler) SetHandlers(handler LogHandler, options *LogOpti
|
||||
}
|
||||
}
|
||||
|
||||
func (h *CompositeMultiHandler) SetJson(writer io.Writer, options *LogOptions) {
|
||||
handler := CallerFileHandler(StreamHandler(writer, JsonFormatEx(
|
||||
func (h *CompositeMultiHandler) SetJSON(writer io.Writer, options *LogOptions) {
|
||||
handler := CallerFileHandler(StreamHandler(writer, JSONFormatEx(
|
||||
options.GetBoolDefault("pretty", false),
|
||||
options.GetBoolDefault("lineSeparated", true),
|
||||
)))
|
||||
@@ -103,7 +106,7 @@ func (h *CompositeMultiHandler) SetJson(writer io.Writer, options *LogOptions) {
|
||||
}
|
||||
|
||||
// Use built in rolling function.
|
||||
func (h *CompositeMultiHandler) SetJsonFile(filePath string, options *LogOptions) {
|
||||
func (h *CompositeMultiHandler) SetJSONFile(filePath string, options *LogOptions) {
|
||||
writer := &lumberjack.Logger{
|
||||
Filename: filePath,
|
||||
MaxSize: options.GetIntDefault("maxSizeMB", 1024), // megabytes
|
||||
@@ -111,7 +114,7 @@ func (h *CompositeMultiHandler) SetJsonFile(filePath string, options *LogOptions
|
||||
MaxBackups: options.GetIntDefault("maxBackups", 7),
|
||||
Compress: options.GetBoolDefault("compress", true),
|
||||
}
|
||||
h.SetJson(writer, options)
|
||||
h.SetJSON(writer, options)
|
||||
}
|
||||
|
||||
func (h *CompositeMultiHandler) SetTerminal(writer io.Writer, options *LogOptions) {
|
||||
|
||||
Reference in New Issue
Block a user