2021-01-17 21:46:25 +08:00
|
|
|
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
2019-06-13 20:29:40 +08:00
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
|
|
|
|
package gview
|
|
|
|
|
|
|
|
import (
|
2021-10-11 21:41:56 +08:00
|
|
|
"github.com/gogf/gf/v2/os/gcmd"
|
2019-06-13 20:29:40 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2021-06-26 12:08:18 +08:00
|
|
|
// commandEnvKeyForErrorPrint is used to specify the key controlling error printing to stdout.
|
2019-06-13 20:29:40 +08:00
|
|
|
// This error is designed not to be returned by functions.
|
2021-06-26 12:08:18 +08:00
|
|
|
commandEnvKeyForErrorPrint = "gf.gview.errorprint"
|
2019-06-13 20:29:40 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// errorPrint checks whether printing error to stdout.
|
|
|
|
func errorPrint() bool {
|
2021-06-26 12:08:18 +08:00
|
|
|
return gcmd.GetOptWithEnv(commandEnvKeyForErrorPrint, true).Bool()
|
2019-06-19 09:06:52 +08:00
|
|
|
}
|