Skip to content

Conversation

@X9VoiD
Copy link
Member

@X9VoiD X9VoiD commented Dec 10, 2023

Moves storage of logs to a file instead of in-memory. Reduces memory usage for long-term use.

Location: <OTD_AppData>/Logs/*.log.json

Things to note:

  • Logging to file is done asynchronously via channel.
  • daemon.log is gone.
  • Maximum number of logs stored is 20.
  • Diagnostics have no functional changes.
  • The resulting log will almost always be an incomplete json array. The parser we use ignores this but is something to take care of when using other tools.

Example log:

[
--- snip ---
{
  "Time": "2023-12-10T22:18:16.624045+08:00",
  "Group": "XP-Pen Star G640S",
  "Message": "Output mode: Absolute Mode",
  "StackTrace": null,
  "Level": 1,
  "Notification": false
},
{
  "Time": "2023-12-10T22:18:16.6575207+08:00",
  "Group": "MouseBinding",
  "Message": "Button: Left",
  "StackTrace": null,
  "Level": 0,
  "Notification": false
},
{
  "Time": "2023-12-10T22:18:16.6706812+08:00",
  "Group": "Settings",
  "Message": "Driver is enabled.",
  "StackTrace": null,
  "Level": 1,
  "Notification": false
},

@X9VoiD X9VoiD added daemon Affects the driver itself desktop OpenTabletDriver.Desktop library, UX and Daemon use this as the core implementation. needs-backport PR or its features needs to be backported to stable branch labels Dec 10, 2023
@X9VoiD X9VoiD requested review from Kuuuube and gonX December 10, 2023 14:34
Copy link
Member

@gonX gonX left a comment

Choose a reason for hiding this comment

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

Haven't tested it but most of the changes makes sense to me

Copy link
Member

@Kuuuube Kuuuube left a comment

Choose a reason for hiding this comment

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

Works. Tested on Win 10.

@X9VoiD X9VoiD merged commit 4d2120e into OpenTabletDriver:master Dec 17, 2023
@X9VoiD X9VoiD deleted the log-file branch December 17, 2023 08:36
@X9VoiD X9VoiD added the backport-added A backport is already merged label Dec 17, 2023
gonX added a commit to gonX/opentabletdriver.github.io that referenced this pull request Mar 11, 2024
OpenTabletDriver removed the crash file and instead logs everything to a single folder.

See OpenTabletDriver/OpenTabletDriver#3100 on GitHub for more information
gonX added a commit to gonX/opentabletdriver.github.io that referenced this pull request Mar 11, 2024
OpenTabletDriver removed the crash file and instead logs everything to a single folder.

See OpenTabletDriver/OpenTabletDriver#3100 on GitHub for more information
gonX added a commit to gonX/opentabletdriver.github.io that referenced this pull request Mar 11, 2024
OpenTabletDriver removed the `daemon.log` crash file and instead logs everything to a single folder.

See OpenTabletDriver/OpenTabletDriver#3100 on GitHub for more information
@gonX gonX removed the needs-backport PR or its features needs to be backported to stable branch label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-added A backport is already merged daemon Affects the driver itself desktop OpenTabletDriver.Desktop library, UX and Daemon use this as the core implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants