Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Log.alert usages #711

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as _ from 'underscore';
import Str from './str';
import * as Constants from './CONST';
import * as UrlPatterns from './Url';
import Log from './Log';

const MARKDOWN_LINK_REGEX = new RegExp(`\\[([^\\][]*(?:\\[[^\\][]*][^\\][]*)*)]\\(${UrlPatterns.MARKDOWN_URL_REGEX}\\)(?![^<]*(<\\/pre>|<\\/code>))`, 'gi');
const MARKDOWN_IMAGE_REGEX = new RegExp(`\\!(?:\\[([^\\][]*(?:\\[[^\\][]*][^\\][]*)*)])?\\(${UrlPatterns.MARKDOWN_URL_REGEX}\\)(?![^<]*(<\\/pre>|<\\/code>))`, 'gi');
Expand Down Expand Up @@ -493,7 +492,8 @@ export default class ExpensiMark {
replacement: (match, g1, offset, string, extras) => {
const reportToNameMap = extras.reportIDToName;
if (!reportToNameMap || !reportToNameMap[g1]) {
Log.alert('[ExpensiMark] Missing report name', {reportID: g1});
// eslint-disable-next-line no-console
console.warn('[ExpensiMark] Missing report name', {reportID: g1});
return '#Hidden';
}

Expand All @@ -507,7 +507,8 @@ export default class ExpensiMark {
if (g1) {
const accountToNameMap = extras.accountIDToName;
if (!accountToNameMap || !accountToNameMap[g1]) {
Log.alert('[ExpensiMark] Missing account name', {accountID: g1});
// eslint-disable-next-line no-console
console.warn('[ExpensiMark] Missing account name', {accountID: g1});
return '@Hidden';
}

Expand Down Expand Up @@ -565,7 +566,8 @@ export default class ExpensiMark {
replacement: (match, g1, offset, string, extras) => {
const reportToNameMap = extras.reportIDToName;
if (!reportToNameMap || !reportToNameMap[g1]) {
Log.alert('[ExpensiMark] Missing report name', {reportID: g1});
// eslint-disable-next-line no-console
console.warn('[ExpensiMark] Missing report name', {reportID: g1});
return '#Hidden';
}

Expand All @@ -578,7 +580,8 @@ export default class ExpensiMark {
replacement: (match, g1, offset, string, extras) => {
const accountToNameMap = extras.accountIDToName;
if (!accountToNameMap || !accountToNameMap[g1]) {
Log.alert('[ExpensiMark] Missing account name', {accountID: g1});
// eslint-disable-next-line no-console
console.warn('[ExpensiMark] Missing account name', {accountID: g1});
return '@Hidden';
}
return `@${extras.accountIDToName[g1]}`;
Expand Down
Loading