Skip to content

Commit 6b92314

Browse files
zeripathjeffliu27
authored andcommitted
Stop colorizing files by default (go-gitea#6949)
1 parent da48ef9 commit 6b92314

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
334334

335335
### Console log mode (`log.console`, `log.console.*`, or `MODE=console`)
336336

337-
- For the console logger `COLORIZE` will default to `true` if not on windows.
337+
- For the console logger `COLORIZE` will default to `true` if not on windows or the terminal is determined to be able to color.
338338
- `STDERR`: **false**: Use Stderr instead of Stdout.
339339

340340
### File log mode (`log.file`, `log.file.*` or `MODE=file`)
@@ -344,7 +344,6 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
344344
- `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file, 28 represents 256Mb.
345345
- `DAILY_ROTATE`: **true**: Rotate logs daily.
346346
- `MAX_DAYS`: **7**: Delete the log file after n days
347-
- NB: `COLORIZE`: will default to `true` if not on windows.
348347
- `COMPRESS`: **true**: Compress old log files by default with gzip
349348
- `COMPRESSION_LEVEL`: **-1**: Compression level
350349

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ from `[log.sublogger]`.
213213
a stacktrace. This value is inherited.
214214
* `MODE` is the mode of the log output. It will default to the sublogger
215215
name. Thus `[log.console.macaron]` will default to `MODE = console`.
216-
* `COLORIZE` will default to `true` for `file` and `console` as
216+
* `COLORIZE` will default to `true` for `console` as
217217
described, otherwise it will default to `false`.
218218

219219
### Non-inherited default values
@@ -274,7 +274,6 @@ Other values:
274274
* `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file, 28 represents 256Mb.
275275
* `DAILY_ROTATE`: **true**: Rotate logs daily.
276276
* `MAX_DAYS`: **7**: Delete the log file after n days
277-
* NB: `COLORIZE`: will default to `true` if not on windows.
278277
* `COMPRESS`: **true**: Compress old log files by default with gzip
279278
* `COMPRESSION_LEVEL`: **-1**: Compression level
280279

modules/setting/log.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"os"
1111
"path"
1212
"path/filepath"
13-
"runtime"
1413
"strings"
1514

1615
"code.gitea.io/gitea/modules/log"
@@ -113,7 +112,6 @@ func generateLogConfig(sec *ini.Section, name string, defaults defaultLogOptions
113112
panic(err.Error())
114113
}
115114

116-
logConfig["colorize"] = sec.Key("COLORIZE").MustBool(runtime.GOOS != "windows")
117115
logConfig["filename"] = logPath
118116
logConfig["rotate"] = sec.Key("LOG_ROTATE").MustBool(true)
119117
logConfig["maxsize"] = 1 << uint(sec.Key("MAX_SIZE_SHIFT").MustInt(28))

0 commit comments

Comments
 (0)