fix: Make logging options more clear for the backend runtime's backend logs
This commit is contained in:
parent
959718163e
commit
5c503f0421
3 changed files with 3 additions and 19 deletions
|
@ -6,10 +6,10 @@ var (
|
|||
AvailableBackends []*Backend
|
||||
RunningBackends map[uint]*Runtime
|
||||
TempDir string
|
||||
isDevelopmentMode bool
|
||||
shouldLog bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
RunningBackends = make(map[uint]*Runtime)
|
||||
isDevelopmentMode = os.Getenv("HERMES_DEVELOPMENT_MODE") != ""
|
||||
shouldLog = os.Getenv("HERMES_DEVELOPMENT_MODE") != "" || os.Getenv("HERMES_BACKEND_LOGGING_ENABLED") != "" || os.Getenv("HERMES_LOG_LEVEL") == "debug"
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ type writeLogger struct {
|
|||
func (writer writeLogger) Write(p []byte) (n int, err error) {
|
||||
logSplit := strings.Split(string(p), "\n")
|
||||
|
||||
if isDevelopmentMode {
|
||||
if shouldLog {
|
||||
for _, logLine := range logSplit {
|
||||
if logLine == "" {
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue