🩹 front: use logger instead of console (#50)
This commit is contained in:
committed by
ericlinagora
parent
e6234f97e4
commit
9048ce7094
+4
-1
@@ -4,6 +4,7 @@ import 'moment/min/locales';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { uniqueId } from 'lodash';
|
||||
|
||||
import Logger from '@features/global/framework/logger-service';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
import BaseBlock from '@molecules/grouped-rows/base';
|
||||
@@ -16,6 +17,8 @@ import { ConfirmModal } from 'app/atoms/modal/confirm';
|
||||
|
||||
import Styles from './styles';
|
||||
|
||||
const getLogger = () => Logger.getLogger('expiry-editor-row');
|
||||
|
||||
export const ExpiryEditorRow = (props: {
|
||||
disabled?: boolean;
|
||||
value: number;
|
||||
@@ -54,7 +57,7 @@ export const ExpiryEditorRow = (props: {
|
||||
setIsEditing(false);
|
||||
},
|
||||
(e: unknown) => {
|
||||
console.error("Error while saving expiry date:", e);
|
||||
getLogger().error("Error while saving expiry date:", e);
|
||||
setIsWaitingForSave(false);
|
||||
},
|
||||
);
|
||||
|
||||
+5
-2
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react';
|
||||
import { uniqueId } from 'lodash';
|
||||
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
import Logger from '@features/global/framework/logger-service';
|
||||
|
||||
import BaseBlock from '@molecules/grouped-rows/base';
|
||||
import { Base } from '@atoms/text';
|
||||
@@ -13,6 +14,8 @@ import { ConfirmModal } from 'app/atoms/modal/confirm';
|
||||
|
||||
import Styles from './styles';
|
||||
|
||||
const getLogger = () => Logger.getLogger('password-editor-row');
|
||||
|
||||
export const PasswordEditorRow = (props: {
|
||||
disabled?: boolean;
|
||||
password?: string;
|
||||
@@ -51,7 +54,7 @@ export const PasswordEditorRow = (props: {
|
||||
setIsEditingPassword(false);
|
||||
},
|
||||
(e: unknown) => {
|
||||
console.error("Error while saving password:", e);
|
||||
getLogger().error("Error while saving password:", e);
|
||||
setIsWaitingForPasswordSave(false);
|
||||
},
|
||||
);
|
||||
@@ -70,7 +73,7 @@ export const PasswordEditorRow = (props: {
|
||||
savePassword(password);
|
||||
}
|
||||
|
||||
return <>
|
||||
return <>
|
||||
<BaseBlock
|
||||
className={"m-4" + (disabled ? Styles.Disabled.Yes : "")}
|
||||
disabled={disabled}
|
||||
|
||||
Reference in New Issue
Block a user