Ejemplo n.º 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 "DCRW":
		log = logger
	case "WLLT":
		walletLog = logger
		wallet.UseLogger(logger)
	case "TMGR":
		txmgrLog = logger
		wtxmgr.UseLogger(logger)
	case "STKM":
		stkmLog = logger
		wstakemgr.UseLogger(logger)
	case "CHNS":
		chainLog = logger
		chain.UseLogger(logger)
		dcrrpcclient.UseLogger(logger)
	case "GRPC":
		grpcLog = logger
		rpcserver.UseLogger(logger)
	case "RPCS":
		legacyRPCLog = logger
		legacyrpc.UseLogger(logger)
	}
}
Ejemplo n.º 2
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 "DCRW":
		log = logger
	case "WLLT":
		walletLog = logger
		wallet.UseLogger(logger)
	case "TMGR":
		txmgrLog = logger
		wtxmgr.UseLogger(logger)
	case "STKM":
		stkmLog = logger
		wstakemgr.UseLogger(logger)
	case "CHNS":
		chainLog = logger
		chain.UseLogger(logger)
	}
}