codingKingKong
V2EX  ›  问与答

如何在调用远程方法前后输出日志

  •  
  •   codingKingKong · Jul 2, 2017 · 1646 views
    This topic created in 3261 days ago, the information mentioned may be changed or developed.

    我描述一下:
    首先远程有 2 个方法 分别是: remote_a() remote_b()
    我本地有一个方法 local_a()

    调用关系是这样的:

        local_a(){
        	log_remote_a_request()
        	remote_a()
            log_remote_a_response()
            log_remote_b_request()
            remote_b()
            log_remote_b_response()
        }
    

    目前是手工添加的日志输出
    问题是我有很多 local_abc...
    怎么才能统一的在调用 remote_a() remote_b() cdefg... 前添加统一的方法呢?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2867 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 03:00 · PVG 11:00 · LAX 20:00 · JFK 23:00
    ♥ Do have faith in what you're doing.