This is an automated email from the ASF dual-hosted git repository.
yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new b9baada543 docs: document the SLF4J placeholder logging convention in
CLAUDE.md (#638)
b9baada543 is described below
commit b9baada5431c24cdc6920cf73e45c69f694df616
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sun Jun 7 20:06:01 2026 -0400
docs: document the SLF4J placeholder logging convention in CLAUDE.md (#638)
Adds a Logging section requiring parameterized {} placeholders over string
concatenation in log statements, with the throwable passed as the trailing
argument.
---
CLAUDE.md | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/CLAUDE.md b/CLAUDE.md
index 5c0496ed6c..e555374792 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -143,6 +143,17 @@ Launched as `IServer` workers in the same JVM:
- **RabbitMQ** — Experiment/process state changes (`experiment_exchange`,
`process_exchange`, `status_exchange`)
- **Kafka** — Real-time job monitoring (`monitoring-data` topic)
+## Logging
+
+Use SLF4J parameterized logging: pass values as `{}` placeholders rather than
string concatenation, so the message template stays readable and arguments are
only stringified when the level is enabled.
+
+```java
+log.info("Could not find {} credentials for token {} in gateway {}", label,
tokenId, gatewayId); // do this
+log.info("Could not find " + label + " credentials for token " + tokenId + "
..."); // not this
+```
+
+A trailing `Throwable` is logged with its stack trace and takes no
placeholder: `log.error("Failed to fetch {}", tokenId, e);`. Exception messages
are plain strings (no placeholder mechanism), so build those normally.
+
## Test Patterns
- JUnit 5 with `@Tag("integration")` and `@Tag("runtime")` categories