1
0
mirror of https://github.com/gogf/gf.git synced 2025-04-05 11:18:50 +08:00

improve package internal/intlog

This commit is contained in:
John 2020-09-24 23:46:19 +08:00
parent a5e3e2f5ba
commit 1d174e00c0

View File

@ -35,7 +35,10 @@ func init() {
// SetEnabled enables/disables the internal logging manually.
// Note that this function is not concurrent safe, be aware of the DATA RACE.
func SetEnabled(enabled bool) {
isGFDebug = enabled
// If they're the same, it does not write the <isGFDebug> but only reading operation.
if isGFDebug != enabled {
isGFDebug = enabled
}
}
// IsEnabled checks and returns whether current process is in GF development.