github.com/decred/dcrd/blockchain@v1.2.1/log.go (about)

     1  // Copyright (c) 2013-2014 The btcsuite developers
     2  // Copyright (c) 2015-2019 The Decred 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 blockchain
     7  
     8  import (
     9  	"github.com/decred/slog"
    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  // The default amount of logging is none.
    16  var log = slog.Disabled
    17  
    18  // DisableLog disables all library log output.  Logging output is disabled
    19  // by default until UseLogger is called.
    20  //
    21  // Deprecated: Use UseLogger(slog.Disabled) instead.
    22  func DisableLog() {
    23  	log = slog.Disabled
    24  }
    25  
    26  // UseLogger uses a specified Logger to output package logging info.
    27  func UseLogger(logger slog.Logger) {
    28  	log = logger
    29  }