Skip to content

Commit 182e079

Browse files
committed
Merge branch 'master' into cloudwatch
2 parents 3d52095 + 318af9b commit 182e079

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ conf/custom.ini
3131
fig.yml
3232
profile.cov
3333
grafana
34+
.notouch

conf/defaults.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ level = Info
224224
# For "console" mode only
225225
[log.console]
226226
level =
227+
# Set formatting to "false" to disable color formatting of console logs
228+
formatting = true
227229

228230
# For "file" mode only
229231
[log.file]

docs/mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ google_analytics: ['UA-47280256-1', 'grafana.org']
2525
pages:
2626

2727
# Introduction:
28-
- ['index.md', 'About', 'Grafana']
28+
- ['index.md', 'Project', 'About Grafana']
29+
- ['project/cla.md', 'Project', 'Contributor License Agreement']
30+
2931
- ['installation/index.md', 'Installation', 'Installation']
3032
- ['installation/debian.md', 'Installation', 'Installing on Debian / Ubuntu']
3133
- ['installation/rpm.md', 'Installation', 'Installing on RPM-based Linux']
3234
- ['installation/mac.md', 'Installation', 'Installing on Mac OS X']
3335
- ['installation/windows.md', 'Installation', 'Installing on Windows']
3436
- ['installation/docker.md', 'Installation', 'Installing on Docker']
37+
- ['project/building_from_source.md', 'Installation', 'Building from Source']
3538

3639
- ['installation/configuration.md', 'Installation', 'Configuration']
3740
- ['installation/ldap.md', 'Installation', 'LDAP Integration']
@@ -70,7 +73,4 @@ pages:
7073
- ['tutorials/index.md', 'Tutorials', 'Tutorials']
7174
- ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana']
7275

73-
- ['project/building_from_source.md', 'Project', 'Building from Source']
74-
- ['project/cla.md', 'Project', 'Contributor License Agreement']
75-
7676
- ['jsearch.md', '**HIDDEN**']

pkg/log/console.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ var (
4545

4646
// ConsoleWriter implements LoggerInterface and writes messages to terminal.
4747
type ConsoleWriter struct {
48-
lg *log.Logger
49-
Level int `json:"level"`
48+
lg *log.Logger
49+
Level int `json:"level"`
50+
Formatting bool `json:"formatting"`
5051
}
5152

5253
// create ConsoleWriter returning as LoggerInterface.
5354
func NewConsole() LoggerInterface {
5455
return &ConsoleWriter{
55-
lg: log.New(os.Stderr, "", log.Ldate|log.Ltime),
56-
Level: TRACE,
56+
lg: log.New(os.Stderr, "", log.Ldate|log.Ltime),
57+
Level: TRACE,
58+
Formatting: true,
5759
}
5860
}
5961

@@ -65,7 +67,7 @@ func (cw *ConsoleWriter) WriteMsg(msg string, skip, level int) error {
6567
if cw.Level > level {
6668
return nil
6769
}
68-
if runtime.GOOS == "windows" {
70+
if runtime.GOOS == "windows" || !cw.Formatting {
6971
cw.lg.Println(msg)
7072
} else {
7173
cw.lg.Println(colors[level](msg))

pkg/setting/setting.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ type CommandLineArgs struct {
140140

141141
func init() {
142142
IsWindows = runtime.GOOS == "windows"
143-
log.NewLogger(0, "console", `{"level": 0}`)
143+
log.NewLogger(0, "console", `{"level": 0, "formatting":true}`)
144144
}
145145

146146
func parseAppUrlAndSubUrl(section *ini.Section) (string, string) {
@@ -527,7 +527,11 @@ func initLogging(args *CommandLineArgs) {
527527
// Generate log configuration.
528528
switch mode {
529529
case "console":
530-
LogConfigs[i] = util.DynMap{"level": level}
530+
formatting := sec.Key("formatting").MustBool(true)
531+
LogConfigs[i] = util.DynMap{
532+
"level": level,
533+
"formatting": formatting,
534+
}
531535
case "file":
532536
logPath := sec.Key("file_name").MustString(filepath.Join(LogsPath, "grafana.log"))
533537
os.MkdirAll(filepath.Dir(logPath), os.ModePerm)

public/app/plugins/datasource/elasticsearch/query_def.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function (_) {
3636
{text: "No limit", value: '0' },
3737
{text: "1", value: '1' },
3838
{text: "2", value: '2' },
39-
{text: "3", value: '4' },
39+
{text: "3", value: '3' },
4040
{text: "5", value: '5' },
4141
{text: "10", value: '10' },
4242
{text: "15", value: '15' },

0 commit comments

Comments
 (0)