github.com/decred/politeia@v1.4.0/politeiawww/legacy/codetracker/github/log.go (about)

     1  // Copyright (c) 2020 The Decred 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 github
     6  
     7  import (
     8  	"github.com/decred/politeia/politeiawww/logger"
     9  	"github.com/decred/slog"
    10  )
    11  
    12  var log = slog.Disabled
    13  
    14  // UseLogger sets the package-wide logger.  Any calls to this function must be
    15  // made before a server is created and used (it is not concurrent safe).
    16  func UseLogger(logger slog.Logger) {
    17  	log = logger
    18  }
    19  
    20  // Initialize the package logger.
    21  func init() {
    22  	UseLogger(logger.NewSubsystem("GHTR"))
    23  }