github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/blockchain/indexers/log.go (about)

     1  // Copyright (c) 2016 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 indexers
     7  
     8  import "github.com/btcsuite/btclog"
     9  
    10  // log is a logger that is initialized with no output filters.  This
    11  // means the package will not perform any logging by default until the caller
    12  // requests it.
    13  var log btclog.Logger
    14  
    15  // The default amount of logging is none.
    16  func init() {
    17  	DisableLog()
    18  }
    19  
    20  // DisableLog disables all library log output.  Logging output is disabled
    21  // by default until either UseLogger or SetLogWriter are called.
    22  func DisableLog() {
    23  	log = btclog.Disabled
    24  }
    25  
    26  // UseLogger uses a specified Logger to output package logging info.
    27  // This should be used in preference to SetLogWriter if the caller is also
    28  // using btclog.
    29  func UseLogger(logger btclog.Logger) {
    30  	log = logger
    31  }