Files
mattermost-mobile/app/utils/log.ts
Avinash Lingaloo 987d024708 Gekidou Sentry Installation (#6726)
* Sentry - Clean Install

* Update config.yml

* update CI to install Sentry CLI

* update CI to install Sentry CLI

* Squashed commit of the following:

commit e1996e59de
Merge: 87cc8d6f2 2e8352f3e
Author: 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

commit 2e8352f3e1
Author: Elias Nahum <nahumhbl@gmail.com>
Date:   Fri Nov 4 15:48:24 2022 +0200

    update CI to install Sentry CLI

commit 87cc8d6f2b
Author: Elias Nahum <nahumhbl@gmail.com>
Date:   Fri Nov 4 15:48:24 2022 +0200

    update CI to install Sentry CLI

commit 8dca885a02
Author: Avinash Lingaloo <avinashlng1080@gmail.com>
Date:   Fri Nov 4 16:48:47 2022 +0400

    Update config.yml

commit 684bbb4aef
Author: 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)

commit 88ff8fac30
Author: Jason Frerich <jason.frerich@mattermost.com>
Date:   Wed Nov 2 19:35:23 2022 -0500

    [Bug] Emit boolean with "of" operator (#6729)

commit debcc99480
Author: 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 commit 75e26faadd.

* refactor after PR Review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-11-11 22:48:38 +04:00

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',
});
};