[xwiki/xwiki-dev-llm] 9cf9e8: [Misc] Record that a log argument is an object, no...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-dev-llm Commit: 9cf9e8c673fb94caac9535c2203cf2b2b1c32c34 https://github.com/xwiki/xwiki-dev-llm/commit/9cf9e8c673fb94caac9535c2203cf2... Author: Vincent Massol <[email protected]> Date: 2026-08-03 (Mon, 03 Aug 2026) Changed paths: M xwiki/instructions/xwiki-org.md A xwiki/okf/conventions/logging.md M xwiki/okf/index.md Log Message: ----------- [Misc] Record that a log argument is an object, not text A logging pass over commons and platform removed explicit toString() calls on log arguments as "redundant, since SLF4J calls toString() itself". That reasoning is wrong for XWiki, because SLF4J is not the only consumer of a log event: AbstractJobStatus captures every warn/error on a job thread, the LogEvent keeps the raw Object[], SafeMessageConverter XStream-serializes each argument as a full object graph whenever XStreamUtils.isSerializable() accepts it (which defaults to true), SafeArrayConverter turns any read failure into null, and consumers read arguments by type -- the log displayers render references as links and Importer casts getArgumentArray()[0] to EntityReference. So both directions are wrong in different cases, which is what the new conventions/logging.md records: the decision table for when to keep an argument typed (references, extension ids, enums, components, collections) and when to force an eager String (arbitrary sources, live resources such as a Hibernate Session, mutable builders, requests, an object whose toString() is deliberately narrower than its fields, a Class from an extension jar), plus the two wrong justifications for removing a toString() and how java:S2629 actually behaves -- String-typed arguments only, no-arg getters and catch blocks exempt -- so that a suppression is only added where one is really needed. The always-on instructions only gain the topic name in the OKF map: this matters when working on a logging call, which is when the OKF gets consulted, so it does not belong in what every session pays for. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Commit: b2f268a97f81457046213a7e94616e49255622ae https://github.com/xwiki/xwiki-dev-llm/commit/b2f268a97f81457046213a7e94616e... Author: Vincent Massol <[email protected]> Date: 2026-08-03 (Mon, 03 Aug 2026) Changed paths: M xwiki/instructions/xwiki-org.md A xwiki/okf/conventions/logging.md M xwiki/okf/index.md Log Message: ----------- [Misc] Record that a log argument is an object, not text Compare: https://github.com/xwiki/xwiki-dev-llm/compare/a1a6fa2ddb12...b2f268a97f81 To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-dev-llm/settings/notifications
participants (1)
-
XWiki Notifications