decred.org/dcrdex@v1.0.5/server/swap/log.go (about)

     1  // This code is available on the terms of the project LICENSE.md file,
     2  // also available online at https://blueoakcouncil.org/license/1.0.0.
     3  
     4  package swap
     5  
     6  import (
     7  	"github.com/decred/slog"
     8  )
     9  
    10  // log is a logger that is initialized with no output filters. This means the
    11  // package will not perform any logging by default until the caller requests it.
    12  var log = slog.Disabled
    13  
    14  // DisableLog disables all library log output.  Logging output is disabled
    15  // by default until UseLogger is called.
    16  func DisableLog() {
    17  	log = slog.Disabled
    18  }
    19  
    20  // UseLogger uses a specified Logger to output package logging info.
    21  func UseLogger(logger slog.Logger) {
    22  	log = logger
    23  }