-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sync_readme
- Loading branch information
Showing
7 changed files
with
157 additions
and
56 deletions.
There are no files selected for viewing
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
Binary file not shown.
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
42 changes: 42 additions & 0 deletions
42
src/main/java/stirling/software/SPDF/config/PostHogLoggerImpl.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,42 @@ | ||
package stirling.software.SPDF.config; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import com.posthog.java.PostHogLogger; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@Component | ||
public class PostHogLoggerImpl implements PostHogLogger { | ||
|
||
@Override | ||
public void debug(String message) { | ||
log.debug(message); | ||
} | ||
|
||
@Override | ||
public void info(String message) { | ||
log.info(message); | ||
} | ||
|
||
@Override | ||
public void warn(String message) { | ||
log.warn(message); | ||
} | ||
|
||
@Override | ||
public void error(String message) { | ||
log.error(message); | ||
} | ||
|
||
@Override | ||
public void error(String message, Throwable throwable) { | ||
if (message.contains("Error sending events to PostHog")) { | ||
log.warn( | ||
"Error sending metrics, Likely caused by no internet connection. Non Blocking"); | ||
} else { | ||
log.error(message, throwable); | ||
} | ||
} | ||
} |
Oops, something went wrong.