Getting gen_server/gen_fsm state for debugging

后端 未结 2 827
执笔经年
执笔经年 2021-02-08 01:09

Is it possible to obtain the current state of a gen_server process (presumably by sending some system message)? It could be useful when debugging.

Of cours

2条回答
  •  余生分开走
    2021-02-08 01:26

    There is actually a function that returns the state directly: sys:get_state/1,2. It accepts pid or name of the process and can optionally be given a timeout.

提交回复
热议问题