We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61a8b48 commit ae61992Copy full SHA for ae61992
modules/log/console_other.go
@@ -0,0 +1,21 @@
1
+// Copyright 2022 The Gitea Authors. All rights reserved.
2
+// Use of this source code is governed by a MIT-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build !windows
6
7
+package log
8
9
+import (
10
+ "os"
11
12
+ "github.com/mattn/go-isatty"
13
+)
14
15
+func init() {
16
+ // when running gitea as a systemd unit with logging set to console, the output can not be colorized,
17
+ // otherwise it spams the journal / syslog with escape sequences like "#033[0m#033[32mcmd/web.go:102:#033[32m"
18
+ // this file covers non-windows platforms.
19
+ CanColorStdout = isatty.IsTerminal(os.Stdout.Fd())
20
+ CanColorStderr = isatty.IsTerminal(os.Stderr.Fd())
21
+}
0 commit comments