Example #1
0
// useLogger updates the logger references for subsystemID to logger.  Invalid
// subsystems are ignored.
func useLogger(subsystemID string, logger btclog.Logger) {
	if _, ok := subsystemLoggers[subsystemID]; !ok {
		return
	}
	subsystemLoggers[subsystemID] = logger

	switch subsystemID {
	case "BTCW":
		log = logger
	case "WLLT":
		walletLog = logger
		wallet.UseLogger(logger)
	case "TXST":
		txmgrLog = logger
		wtxmgr.UseLogger(logger)
	case "CHNS":
		chainLog = logger
		chain.UseLogger(logger)
		btcrpcclient.UseLogger(logger)
	case "GRPC":
		grpcLog = logger
		rpcserver.UseLogger(logger)
	case "RPCS":
		legacyRPCLog = logger
		legacyrpc.UseLogger(logger)
	}
}
Example #2
0
// UseLogger uses a specified Logger to output package logging info.
// This should be used in preference to SetLogWriter if the caller is also
// using btclog.
func UseLogger(logger btclog.Logger) {
	walletLog = logger
	btcwallet.UseLogger(logger)
}