Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several improvements to debug logging, to improve our ability to parse the logs and gather useful information:
PeerSyncController
logger, that was creating a newDebugger
instance (by callingLogger.create()
) each time anything was logged.PeerSyncController
which was adding apeer-remove
event listener every time a core is replicated, and never removing the listener. This was solely for debugging. Now only adds the listener if debugging is enabled.PeerSyncController
and expose theCoreRecord
of the creator core, to enable this namespace logging.PeerSyncController
.SyncApi
: only log change of sync enabled state, rather than logging it on every state update.SyncApi
: Remove superflous logging for when cores are added (adding cores is logged by core manager).supports-color
dev dependency, whichdebug
uses if available to support more colors (it was using this anyway, as a transitive dependency included by an unrelated module, but this makes the dependency more explicit).MapeoProject
MapeoManager.#waitForInitialSync
to show why sync is pending.debug
module to color debug lines according to the deviceId, rather than a different color for each namespace. Simplifies identifying which debug lines come from each peer in tests.Logger.log
is now an instance ofdebug.Debugger
, with its properties such asDebugger.enabled
. Before it was just a function that wrappeddebug.Debugger
.