github.com/decred/politeia@v1.4.0/politeiawww/log.go (about) 1 // Copyright (c) 2013-2015 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 main 6 7 import ( 8 "github.com/decred/politeia/politeiawww/logger" 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 var log = slog.Disabled 16 17 // UseLogger uses a specified Logger to output package logging info. 18 // This should be used in preference to SetLogWriter if the caller is also 19 // using slog. 20 func UseLogger(logger slog.Logger) { 21 log = logger 22 } 23 24 // Initialize the package logger. 25 func init() { 26 UseLogger(logger.NewSubsystem("PWWW")) 27 }