mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
Improve Logging (#1519)
Improve Logging Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
1172a1d7b8
commit
0e512531a0
41 changed files with 361 additions and 92 deletions
|
@ -8,6 +8,9 @@ import i18n, { TOptions } from 'i18next'
|
|||
import { store } from '../index'
|
||||
import { DismissUiNotificationAction, DispatchOptions, UiNotificationActionType } from './types'
|
||||
import { DateTime } from 'luxon'
|
||||
import { Logger } from '../../utils/logger'
|
||||
|
||||
const log = new Logger('Redux > Notifications')
|
||||
|
||||
export const DEFAULT_DURATION_IN_SECONDS = 10
|
||||
|
||||
|
@ -70,7 +73,7 @@ export const dismissUiNotification = (notificationId: number): void => {
|
|||
export const showErrorNotification =
|
||||
(messageI18nKey: string, messageI18nOptions?: TOptions | string) =>
|
||||
(error: Error): void => {
|
||||
console.error(i18n.t(messageI18nKey, messageI18nOptions), error)
|
||||
log.error(i18n.t(messageI18nKey, messageI18nOptions), error)
|
||||
void dispatchUiNotification('common.errorOccurred', messageI18nKey, {
|
||||
contentI18nOptions: messageI18nOptions,
|
||||
icon: 'exclamation-triangle'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue