Skip to content

Commit f968acf

Browse files
[Sdk 428] Simplify logger module (#24)
* Not stable state * Logs reworked * Log calls updated! * fixed logger issues * fixed all build error. * Null pointer exception fixed! * unit tests fixed! * Verbose level added! * Log listener added * change log updated removed exception log mthods, fixed log printing calls, * Update CHANGELOG.md * Loglevel enum ordre updated Logcall interface moved to a seprate file * - gitingnored file updated - Logcallback interface file added Co-authored-by: Zahid Zafar <> Co-authored-by: ArtursKadikis <[email protected]>
1 parent cbfeb5f commit f968acf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+622
-766
lines changed

.gitignore

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
.gradle
2-
/local.properties
3-
/.idea/workspace.xml
4-
/.idea/libraries
5-
.DS_Store
6-
/build
7-
.idea/caches/
8-
sdkJava/build/
9-
core/build/
10-
sdk-java/build/
11-
*.attach_pid*
12-
sdk-java/
13-
app-java/out/
1+
.gradle
2+
/local.properties
3+
/.idea/workspace.xml
4+
/.idea/libraries
5+
.DS_Store
6+
/build
7+
.idea/caches/
8+
sdkJava/build/
9+
core/build/
10+
sdk-java/build/
11+
*.attach_pid*
12+
app-java/out/
13+
data

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
22.06.0
2+
* ! Minor breaking change ! The following methods and their functionality is removed from the "Config" class: "enableTestMode", "disableTestMode" and "isTestModeEnabled". The "TestMode" functionality is being removed from the SDK.
3+
14
20.11.5
25
* Fixed a bug where the backend mode module produces "null pointer exceptions" in case not initialized.
36

sdk-java/src/main/java/ly/count/sdk/java/Cly.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ public abstract class Cly implements Usage {
1010
protected static Cly cly;
1111
protected CtxCore ctx;
1212
protected SDKInterface sdkInterface;
13+
14+
protected Log L = null;
1315

14-
private static final Log.Module L = Log.module("Cly");
15-
16-
protected Cly() {
16+
protected Cly(Log logger) {
1717
cly = this;
18+
L = logger;
1819
}
1920

2021
protected static Session session(CtxCore ctx) {
@@ -27,13 +28,13 @@ protected static Session getSession() {
2728

2829
@Override
2930
public Event event(String key) {
30-
L.d("event: key = " + key);
31+
L.d("[Cly] event: key = " + key);
3132
return ((Session) sdkInterface.session(ctx, null)).event(key);
3233
}
3334

3435
@Override
3536
public Event timedEvent(String key) {
36-
L.d("timedEvent: key = " + key);
37+
L.d("[Cly] timedEvent: key = " + key);
3738
return ((Session) sdkInterface.session(ctx, null)).timedEvent(key);
3839
}
3940

@@ -46,43 +47,43 @@ public Event timedEvent(String key) {
4647
*/
4748
@Override
4849
public User user() {
49-
L.d("user");
50+
L.d("[Cly] user");
5051
return ((Session) sdkInterface.session(ctx, null)).user();
5152
}
5253

5354
@Override
5455
public Usage addParam(String key, Object value) {
55-
L.d("addParam: key = " + key + " value = " + value);
56+
L.d("[Cly] addParam: key = " + key + " value = " + value);
5657
return ((Session) sdkInterface.session(ctx, null)).addParam(key, value);
5758
}
5859

5960
@Override
6061
public Usage addCrashReport(Throwable t, boolean fatal) {
61-
L.d("addCrashReport: t = " + t + " fatal = " + fatal);
62+
L.d("[Cly] addCrashReport: t = " + t + " fatal = " + fatal);
6263
return ((Session) sdkInterface.session(ctx, null)).addCrashReport(t, fatal);
6364
}
6465

6566
@Override
6667
public Usage addCrashReport(Throwable t, boolean fatal, String name, Map<String, String> segments, String... logs) {
67-
L.d("addCrashReport: t = " + t + " fatal = " + fatal + " name = " + name + " segments = " + segments + " logs = " + logs);
68+
L.d("[Cly] addCrashReport: t = " + t + " fatal = " + fatal + " name = " + name + " segments = " + segments + " logs = " + logs);
6869
return ((Session) sdkInterface.session(ctx, null)).addCrashReport(t, fatal, name, segments, logs);
6970
}
7071

7172
@Override
7273
public Usage addLocation(double latitude, double longitude) {
73-
L.d("addLocation: latitude = " + latitude + " longitude = " + longitude);
74+
L.d("[Cly] addLocation: latitude = " + latitude + " longitude = " + longitude);
7475
return ((Session) sdkInterface.session(ctx, null)).addLocation(latitude, longitude);
7576
}
7677

7778
@Override
7879
public View view(String name, boolean start) {
79-
L.d("view: name = " + name + " start = " + start);
80+
L.d("[Cly] view: name = " + name + " start = " + start);
8081
return ((Session) sdkInterface.session(ctx, null)).view(name, start);
8182
}
8283

8384
@Override
8485
public View view(String name) {
85-
L.d("view: name = " + name);
86+
L.d("[Cly] view: name = " + name);
8687
return ((Session) sdkInterface.session(ctx, null)).view(name);
8788
}
8889
}

0 commit comments

Comments
 (0)