github.com/hedzr/evendeep@v0.4.8/dbglog/lessmaplog.go (about)

     1  //go:build moremaplog
     2  // +build moremaplog
     3  
     4  package dbglog
     5  
     6  // MoreMapLog shows the buildtag 'moremaplog' is enabled or not.
     7  //
     8  // This flag is used for hedzr/evendeep package so that it can print
     9  // more debug logging messages when copying map struct.
    10  //
    11  // You may borrow the mechanism to dump the more verbose messages for
    12  // debugging purpose.
    13  const MoreMapLog = true
    14  
    15  // DisableLog can be used to disable dbglog.Log at runtime.
    16  //
    17  // It detects and prevent log output if buildtag 'moremaplog' present.
    18  //
    19  // To query the active state by calling ChildLogEnabled.
    20  //
    21  // The best practise for DisableLog is:
    22  //
    23  //    defer dbglog.DisableLog()()
    24  //    evendeep.CopyTo(...) // the verbose logging will be prevent even if buildtag 'verbose' defined.
    25  //
    26  // If you want to enable/disable dbglog.Log manually, try SetLogEnabled and SetLogDisabled.
    27  func DisableLog() func()    { return func() {} }
    28  func ChildLogEnabled() bool { return true }