[Reslove]Lldb collect log error

When I use the following code to collect logs.
When using Xcode to run the app for the first time, one log will be collected, then two logs will be collected for the second time, and three logs will be received for the third time.
If I add a build phase to kill lldb-rpc-server every time I run the app, then repeat the above steps, collecting a log for the first time, a log for the second time, and a log for the third time.

//code simple
import logging
import datetime
import json

class Log:
    __logger = logging.getLogger('bdchisel')
    fh = logging.FileHandler('/tmp/bdchisel.log')
    formatter = logging.Formatter('%(message)s')
    def log(jsondict):
        utc_datetime = datetime.datetime.utcnow()
        time = utc_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")
        jsondict['time'] = time

def __lldb_init_module(debugger, dict):