github.com/palcoin-project/palcd@v1.0.0/netsync/log.go (about)

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