Skip to content

About difference log_path #687

Description

@tqjason
llmcore.py @949
log_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), f'temp/model_responses/model_responses_{os.getpid()}.txt')

agentmain.py @62-63
logid = f'{(time.time_ns() + random.randrange(1_000_000)) % 1_000_000:06d}'
self.log_path = os.path.join(script_dir, f'temp/model_responses/model_responses_{logid}.txt')

frontends/continue_cmd.py
@1025
def _new_log_path():
    """铸一个新的 6 位 logid 日志路径(与 agentmain 同公式)。"""
    logid = f'{(time.time_ns() + random.randrange(1_000_000)) % 1_000_000:06d}'
    return os.path.join(_LOG_DIR, f'model_responses_{logid}.txt')

@446
def _current_log_path(pid=None):
    pid = os.getpid() if pid is None else pid
    return os.path.join(_LOG_DIR, f'model_responses_{pid}.txt')

@451
def _snapshot_current_log(pid=None):
...
...
    pid = os.getpid() if pid is None else pid
    stamp = time.strftime('%Y%m%d_%H%M%S')
    snapshot = os.path.join(_LOG_DIR, f'model_responses_snapshot_{pid}_{stamp}_{time.time_ns() % 1_000_000_000:09d}.txt')

Are these ok?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions