Skip to content

Describe logging in README - #204

Merged
ruccho merged 1 commit into
mainfrom
doc/logging
Oct 30, 2026
Merged

ruccho merged 1 commit into
mainfrom
doc/logging

Conversation

@ruccho

@ruccho ruccho commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a section on logging to the README, in English (README.md) and Japanese (README.ja.md). The logging features had not been described anywhere except in the changelog.

The section explains that Instant Replay emits log messages from two independent sources, and describes each of them:

  • The C# code of the package
    • How to redirect the messages by assigning an implementation to InstantReplay.ILogger.Logger, with an example.
    • The name collision with UnityEngine.ILogger.
    • The requirement that an implementation be thread-safe, because the methods are also called from background threads.
  • The native encoding library
    • The destination of the messages on each platform, including the fallback to logcat under the unienc tag on Android before Unity has loaded the plugin.
    • The default level (Warn) and how to change it with UniEnc.NativeLogging.SetLevel.
    • The settings under Preferences > UniEnc: Native Log Level, which is also sent to connected development builds, and Bake Into Player Builds.
    • The performance cost of the Debug and Trace levels in development builds, where Unity captures a stack trace for each message.

This PR also corrects the doc comment of unienc_set_log_level, which stated that the default level of release builds of the native library is Info. The default has been Warn since the level was changed, and NativeLogging.SetLevel and the Preferences window already said so. The generated NativeMethods.g.cs was edited by hand to match, which is the same output that csbindgen produces from the corrected comment.

The destinations on Web (the browser console) and iOS (the Xcode console) are inferred from the code and have not been confirmed on a device.

README and README.ja.md describe how to redirect the log messages of the C# code through InstantReplay.ILogger, where the native library writes its log messages, and how to change the native log level from code or from the Preferences window.

The doc comment of unienc_set_log_level stated that the default level of release builds is Info. It is Warn.
@ruccho
ruccho marked this pull request as ready for review October 30, 2026 01:56
@ruccho
ruccho merged commit f973e31 into main Oct 30, 2026
7 checks passed
@ruccho
ruccho deleted the doc/logging branch October 30, 2026 01:56
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.

1 participant