g_setting.go 915 B

1234567891011121314151617181920212223242526
  1. // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
  2. //
  3. // This Source Code Form is subject to the terms of the MIT License.
  4. // If a copy of the MIT was not distributed with this file,
  5. // You can obtain one at https://github.com/gogf/gf.
  6. package g
  7. import (
  8. "github.com/gogf/gf/internal/intlog"
  9. "github.com/gogf/gf/net/ghttp"
  10. )
  11. // SetEnabled enables/disables the GoFrame internal logging manually.
  12. // Note that this function is not concurrent safe, be aware of the DATA RACE,
  13. // which means you should call this function in your boot but not the runtime.
  14. func SetDebug(enabled bool) {
  15. intlog.SetEnabled(enabled)
  16. }
  17. // SetServerGraceful enables/disables graceful reload feature of http Web Server.
  18. // This feature is disabled in default.
  19. // Deprecated, use configuration of ghttp.Server for controlling this feature.
  20. func SetServerGraceful(enabled bool) {
  21. ghttp.SetGraceful(enabled)
  22. }