Skip to content

Commit f5b80ff

Browse files
committed
fix: SessionRecorder usage
1 parent b391ae0 commit f5b80ff

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ SessionRecorder.init(config);
3535
// Use it with static methods
3636
Session session = new Session();
3737
session.setName("My Session");
38+
39+
// Add tags if needed
40+
session.addTag("environment", "production");
41+
session.addTag("version", "1.0.0");
42+
3843
SessionRecorder.start(SessionType.PLAIN, session);
3944
```
4045

src/main/java/app/multiplayer/session_recorder/type/Session.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ public void setTags(List<Tag> tags) {
6464
this.tags = tags;
6565
}
6666

67+
/**
68+
* Add a tag to the session
69+
* @param key the tag key
70+
* @param value the tag value
71+
*/
72+
public void addTag(String key, String value) {
73+
this.tags.add(new Tag(key, value));
74+
}
75+
76+
/**
77+
* Add a tag to the session
78+
* @param tag the tag to add
79+
*/
80+
public void addTag(Tag tag) {
81+
this.tags.add(tag);
82+
}
83+
6784
// --- Inner class for Tag ---
6885

6986
public static class Tag {

0 commit comments

Comments
 (0)