[PR #3269] [CLOSED] Log actual object details when they appear in log arguments #3918

Closed
opened 2026-04-25 00:17:34 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3269
Author: @BlackHoleFox
Created: 8/11/2024
Status: Closed

Base: masterHead: improved-libraryitem-debug-logging


📝 Commits (1)

  • fb73d95 Log actual object details when they appear in log arguments

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 server/models/LibraryItem.js (+10 -1)

📄 Description

I'm continuing to hunt down the root cause of #2785 and got tired of seeing [object Object] around relevant logging lines. Its impossible to tell what the server is actually seeing change today:

{"timestamp":"2024-08-08 00:00:23.785","source":"LibraryItem.js:305","message":"[LibraryItem] \"name\" audioFile was updated from \"[object Object]\" to \"[object Object]\"","levelName":"DEBUG","level":1}
{"timestamp":"2024-08-08 00:00:23.786","source":"LibraryItem.js:305","message":"[LibraryItem] \"name\" extraData was updated from \"null\" to \"[object Object]\"","levelName":"DEBUG","level":1}

The changes here serialize the objects into JSON to remove the opaqueness to make them an actual string. Should have no effect on most users since I haven't really seen any logs containing these at non debug levels.

Do let me know if this can be cleaner. I don't usually write JS :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3269 **Author:** [@BlackHoleFox](https://github.com/BlackHoleFox) **Created:** 8/11/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `improved-libraryitem-debug-logging` --- ### 📝 Commits (1) - [`fb73d95`](https://github.com/advplyr/audiobookshelf/commit/fb73d95f19a00c4194f8507a1f24227507f7c21f) Log actual object details when they appear in log arguments ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/models/LibraryItem.js` (+10 -1) </details> ### 📄 Description I'm continuing to hunt down the root cause of #2785 and got tired of seeing `[object Object]` around relevant logging lines. Its impossible to tell what the server is actually seeing change today: ``` {"timestamp":"2024-08-08 00:00:23.785","source":"LibraryItem.js:305","message":"[LibraryItem] \"name\" audioFile was updated from \"[object Object]\" to \"[object Object]\"","levelName":"DEBUG","level":1} {"timestamp":"2024-08-08 00:00:23.786","source":"LibraryItem.js:305","message":"[LibraryItem] \"name\" extraData was updated from \"null\" to \"[object Object]\"","levelName":"DEBUG","level":1} ``` The changes here serialize the objects into JSON to remove the opaqueness to make them an actual string. Should have no effect on most users since I haven't really seen any logs containing these at non debug levels. Do let me know if this can be cleaner. I don't usually write JS :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:34 +02:00
adam closed this issue 2026-04-25 00:17:34 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3918