示例#1
0
文件: log.go 项目: decred/dcrwallet
// 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)
	}
}
示例#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)
	}
}