2019-02-20 16:07:11 +08:00
|
|
|
// Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
|
|
|
//
|
|
|
|
// 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 g
|
|
|
|
|
2020-09-24 23:40:44 +08:00
|
|
|
import (
|
|
|
|
"github.com/gogf/gf/internal/intlog"
|
|
|
|
"github.com/gogf/gf/net/ghttp"
|
|
|
|
)
|
|
|
|
|
|
|
|
// SetEnabled enables/disables the GoFrame internal logging manually.
|
|
|
|
// Note that this function is not concurrent safe, be aware of the DATA RACE,
|
|
|
|
// which means you should call this function in your boot but not the runtime.
|
|
|
|
func SetDebug(enabled bool) {
|
|
|
|
intlog.SetEnabled(enabled)
|
|
|
|
}
|
2019-02-20 16:07:11 +08:00
|
|
|
|
2019-06-21 22:23:07 +08:00
|
|
|
// SetServerGraceful enables/disables graceful reload feature of http Web Server.
|
2019-04-04 22:52:56 +08:00
|
|
|
// This feature is disabled in default.
|
2020-02-23 20:25:55 +08:00
|
|
|
// Deprecated, use configuration of ghttp.Server for controlling this feature.
|
2019-02-20 16:07:11 +08:00
|
|
|
func SetServerGraceful(enabled bool) {
|
2019-06-19 09:06:52 +08:00
|
|
|
ghttp.SetGraceful(enabled)
|
2019-02-20 16:07:11 +08:00
|
|
|
}
|