-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
baac781
commit 60510dc
Showing
4 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
posthog/src/main/java/com/posthog/java/DefaultPostHogLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.posthog.java; | ||
|
||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
public class DefaultPostHogLogger implements PostHogLogger { | ||
private final Logger logger; | ||
|
||
public DefaultPostHogLogger() { | ||
this.logger = Logger.getLogger(PostHog.class.getName()); | ||
} | ||
|
||
@Override | ||
public void debug(String message) { | ||
logger.fine(message); | ||
} | ||
|
||
@Override | ||
public void info(String message) { | ||
logger.info(message); | ||
} | ||
|
||
@Override | ||
public void warn(String message) { | ||
logger.warning(message); | ||
} | ||
|
||
@Override | ||
public void error(String message) { | ||
logger.severe(message); | ||
} | ||
|
||
@Override | ||
public void error(String message, Throwable throwable) { | ||
logger.log(Level.SEVERE, message, throwable); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.posthog.java; | ||
|
||
/** | ||
* Allows you to inject a logger to the PostHog library | ||
* We configure the DefaultPostHogLogger if one is not provided | ||
*/ | ||
public interface PostHogLogger { | ||
void debug(String message); | ||
void info(String message); | ||
void warn(String message); | ||
void error(String message); | ||
void error(String message, Throwable throwable); | ||
} |