mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
18 lines
390 B
TypeScript
18 lines
390 B
TypeScript
import log from "electron-log";
|
|
|
|
export const setSentryLogging = (sentry: any) => {
|
|
const oldError = log.error;
|
|
|
|
log.error = (...params: any[]) => {
|
|
if (process.env.TEST === "true") {
|
|
log.info(params);
|
|
return;
|
|
}
|
|
|
|
oldError(params);
|
|
sentry.captureException(params[0].message);
|
|
};
|
|
};
|
|
|
|
// Export the log object to use it throughout the app
|
|
export default log;
|