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')
__logger.setLevel(logging.INFO)
fh = logging.FileHandler('/tmp/bdchisel.log')
formatter = logging.Formatter('%(message)s')
fh.setFormatter(formatter)
__logger.addHandler(fh)
@staticmethod
def log(jsondict):
utc_datetime = datetime.datetime.utcnow()
time = utc_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")
jsondict['time'] = time
Log.__logger.info(json.dumps(jsondict))
def __lldb_init_module(debugger, dict):
Log.log({})