Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Aug 19, 2025

This PR avoids hardcoding the "debug.log" filename, ensuring compatibility with custom filenames provided via the -debuglogfile command-line option.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 19, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33215.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34038 (logging: API improvements by ajtowns)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

},
RPCResult{
RPCResult::Type::BOOL, "", "Verification finished successfully. If false, check debug.log for reason."},
RPCResult::Type::BOOL, "", strprintf("Verification finished successfully. If false, check %s for reason.", fs::PathToString(LogInstance().m_file_path))},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RPCResult::Type::BOOL, "", strprintf("Verification finished successfully. If false, check %s for reason.", fs::PathToString(LogInstance().m_file_path))},
RPCResult::Type::BOOL, "", "Verification finished successfully. If false, check debug log for reason."},

I don't think it makes sense to include the real filename in RPC results.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is the RPC doc, not the RPC result. No opinion about the result, but it must not be in the doc. Otherwise, the doc is confusing, brittle and highly mutable.


if (!node::LoadMempool(mempool, load_path, chainstate, std::move(opts))) {
throw JSONRPCError(RPC_MISC_ERROR, "Unable to import mempool file, see debug.log for details.");
throw JSONRPCError(RPC_MISC_ERROR, strprintf("Unable to import mempool file, see %s for details.", fs::PathToString(LogInstance().m_file_path)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw JSONRPCError(RPC_MISC_ERROR, strprintf("Unable to import mempool file, see %s for details.", fs::PathToString(LogInstance().m_file_path)));
throw JSONRPCError(RPC_MISC_ERROR, "Unable to import mempool file, see debug log for details.");

luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Aug 20, 2025
This change avoids hardcoding the "debug.log" filename, ensuring
compatibility with custom filenames provided via the `-debuglogfile`
command-line option.

Github-Pull: bitcoin#33215
Rebased-From: af1b42b
This change avoids hardcoding the "debug.log" filename, ensuring
compatibility with custom filenames provided via the `-debuglogfile`
command-line option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants