forked from Ivasoft/mattermost-mobile
* Sentry - Clean Install * Update config.yml * update CI to install Sentry CLI * update CI to install Sentry CLI * Squashed commit of the following: commite1996e59deMerge:87cc8d6f22e8352f3eAuthor: Avinash Lingaloo <avinashlng1080@gmail.com> Date: Fri Nov 4 20:59:29 2022 +0400 Merge branch 'android-pr-sentry-clean' of https://github.com/mattermost/mattermost-mobile into android-pr-sentry-clean commit2e8352f3e1Author: Elias Nahum <nahumhbl@gmail.com> Date: Fri Nov 4 15:48:24 2022 +0200 update CI to install Sentry CLI commit87cc8d6f2bAuthor: Elias Nahum <nahumhbl@gmail.com> Date: Fri Nov 4 15:48:24 2022 +0200 update CI to install Sentry CLI commit8dca885a02Author: Avinash Lingaloo <avinashlng1080@gmail.com> Date: Fri Nov 4 16:48:47 2022 +0400 Update config.yml commit684bbb4aefAuthor: Mylon Suren <23694620+mylonsuren@users.noreply.github.com> Date: Thu Nov 3 11:37:58 2022 -0400 Remove down arrow next to team name and make team name unclickable (#6715) commit88ff8fac30Author: Jason Frerich <jason.frerich@mattermost.com> Date: Wed Nov 2 19:35:23 2022 -0500 [Bug] Emit boolean with "of" operator (#6729) commitdebcc99480Author: Jason Frerich <jason.frerich@mattermost.com> Date: Wed Nov 2 12:15:54 2022 -0500 [Gekidou MM-48006] Show keyboard when select a modifier (#6714) * Delete @sentry+react-native+4.6.1.patch * correction from PR review * Add logError to DatabaseManager * removes sentry context from android build job * removes team+channel data * shift active server listener to home/index * Revert "shift active server listener to home/index" This reverts commit75e26faadd. * refactor after PR Review Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import keyMirror from '@utils/key_mirror';
|
|
|
|
const SentryLevels = keyMirror({debug: null, info: null, warning: null, error: null});
|
|
|
|
export function logError(...args: any[]) {
|
|
// eslint-disable-next-line no-console
|
|
console.error(...args);
|
|
addBreadcrumb(SentryLevels.error, ...args);
|
|
}
|
|
|
|
export function logWarning(...args: any[]) {
|
|
// eslint-disable-next-line no-console
|
|
console.warn(...args);
|
|
addBreadcrumb(SentryLevels.warning, ...args);
|
|
}
|
|
|
|
export function logInfo(...args: any[]) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(...args);
|
|
addBreadcrumb(SentryLevels.info, ...args);
|
|
}
|
|
|
|
export function logDebug(...args: any[]) {
|
|
// eslint-disable-next-line no-console
|
|
console.debug(...args);
|
|
addBreadcrumb(SentryLevels.debug, ...args);
|
|
}
|
|
|
|
const addBreadcrumb = (logLevel: keyof typeof SentryLevels, ...args: any[]) => {
|
|
const Sentry = require('@sentry/react-native');
|
|
Sentry.addBreadcrumb({
|
|
level: logLevel,
|
|
message: args.join(','),
|
|
type: 'console-log',
|
|
});
|
|
};
|