github.com/BlockABC/godash@v0.0.0-20191112120524-f4aa3a32c566/addrmgr/log.go (about)

     1  // Copyright (c) 2013-2014 The btcsuite developers
     2  // Copyright (c) 2016 The Dash developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  package addrmgr
     7  
     8  import (
     9  	"github.com/btcsuite/btclog"
    10  )
    11  
    12  // log is a logger that is initialized with no output filters.  This
    13  // means the package will not perform any logging by default until the caller
    14  // requests it.
    15  var log btclog.Logger
    16  
    17  // The default amount of logging is none.
    18  func init() {
    19  	DisableLog()
    20  }
    21  
    22  // DisableLog disables all library log output.  Logging output is disabled
    23  // by default until either UseLogger or SetLogWriter are called.
    24  func DisableLog() {
    25  	log = btclog.Disabled
    26  }
    27  
    28  // UseLogger uses a specified Logger to output package logging info.
    29  // This should be used in preference to SetLogWriter if the caller is also
    30  // using btclog.
    31  func UseLogger(logger btclog.Logger) {
    32  	log = logger
    33  }