Skip to content

Fix/reduce log noise - #344

Open
jolavillette wants to merge 3 commits into
RetroShare:masterfrom
jolavillette:fix/reduce-log-noise
Open

Fix/reduce log noise#344
jolavillette wants to merge 3 commits into
RetroShare:masterfrom
jolavillette:fix/reduce-log-noise

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

Fix/reduce log noise

removes a lot of non relevant outputs from the console

@jolavillette
jolavillette force-pushed the fix/reduce-log-noise branch from 7198e9f to 101d46c Compare July 25, 2026 19:34
Comment thread src/pqi/pqissllistener.cc
out += "\npqissllistener => Passing to pqissl module!";
pqioutput(PQL_WARNING, pqissllistenzone, out);

std::cerr << "pqissllistenner::finaliseConnection() connected to " << sockaddr_storage_tostring(remote_addr) << std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you keep this line?

if(!mCircles->recipients(destination_circle,destination_group,recipients))
{
std::cerr << " (EE) Cannot encrypt transaction: recipients list not available. Should re-try later." << std::endl;
// Not an error: the circle membership may simply not be cached yet. The caller retries later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This one can be seen as an error. Generally speaking if the circle known, all the identities should be there as well.

static RsMutex banned_drop_log_mtx("bannedDropLog");
static std::map<RsGxsId,std::pair<uint32_t,rstime_t> > stats; // id -> (drops since last report, last report time)

RS_STACK_MUTEX(banned_drop_log_mtx);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make sure we actually need a mutex here. All the calls come from the loop that receives chat items.

@jolavillette
jolavillette force-pushed the fix/reduce-log-noise branch from 101d46c to ebb3048 Compare July 26, 2026 19:43
jolavillette and others added 3 commits July 27, 2026 22:05
None of these change behavior; they only fix logging level/volume for
conditions that are normal and already handled by the code.

- p3MsgService::loadList(): drop the per-message RsErr() dump of msg.to
  (was ~1 ERROR line per stored mail at every startup).
- p3MsgService::locked_checkForDuplicates(): collapse the per-ID
  "Duplicate ID ... replaced" warnings into a single summary line per
  message box (and one for msgOutgoing). msgId is a uint32, so ID
  collisions in a large store are expected and recovered by renumbering;
  no need for one WARN per collision (was ~1000 lines at startup).
- p3IdService::cache_store(): gate "No Public Key Found" behind
  DEBUG_IDS. Identity data can legitimately arrive before/without its
  public key; the caller retries later, so this is not an error.
- RsGxsNetService::encryptSingleNxsItem(): gate "Cannot encrypt
  transaction: recipients list not available" behind NXS_NET_DEBUG_7.
  The circle membership may simply not be cached yet; it is retried.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… drops

Two more high-volume, non-error log sources, both left behaving exactly
as before (nothing is hidden):

- RNPPGPHandler::initCertificateInfo(): gate the per-key keyring dump
  (one "type/Key id/fingerprint" line + one "N signers" line per key)
  behind DEBUG_PGP_KEYRING_DUMP, off by default. With a large keyring
  this is thousands of lines of pure inventory at every startup. Key
  parse errors throw, so gating hides nothing; the "Loaded N public
  keys" summary is still printed unconditionally.

- DistributedChatService: a single locally-banned identity can flood a
  lobby with thousands of items, and the code logged one WARN per
  dropped item. Every item is still dropped (correct, expected
  behaviour); logBannedIdentityDrop() now rate-limits the log to one
  line when the flood starts plus one summary per identity per 60s
  carrying the dropped count. Signature mismatches and other genuine
  problems remain logged separately and unconditionally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Same information as before (nothing hidden), fewer lines per connection.
Only the success-path step-by-step trace in pqissllistener is touched;
authssl / pqissl outcome lines and every failure line are left as-is.

- continueSSL(): the incoming cert identity was dumped over 4 lines
  (ContinueSSL / Got PGP Id / Got SSL Id / Got SSL CN) inside an inverted
  "#ifndef DEBUG_LISTENNER" guard (i.e. on by default, and defining the
  macro would have hidden it). Collapse to one RsInfo line carrying the
  same pgpId / sslId / CN, unconditionally.

- finaliseConnection(): the success path emitted 5 lines (function name,
  "checking:", "Found Matching Peer", "Passing to pqissl module", plus a
  redundant std::cerr "connected to"). Collapse to one line keeping the
  peer id, remote address and outcome. Same for the no-match failure
  path: one line keeping peer id, address and reason.

- finaliseAccepts() / isSSLActive(): two pure step markers with no data
  were logged at PQL_WARNING; demote to PQL_DEBUG_BASIC so the existing
  level filter (default = Warning) drops them, without deleting them.

Net: an incoming successful connection goes from ~11 lines to ~2 in this
file, with every field preserved. Failure diagnostics are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jolavillette
jolavillette force-pushed the fix/reduce-log-noise branch from ebb3048 to 7702393 Compare July 27, 2026 20:05
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.

2 participants