mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -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
|
@ -10,6 +10,7 @@ import { useTranslation } from 'react-i18next'
|
|||
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
||||
import { ShowIf } from '../../show-if/show-if'
|
||||
import { CopyOverlay } from '../copy-overlay'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
|
||||
export interface CopyableFieldProps {
|
||||
content: string
|
||||
|
@ -17,6 +18,8 @@ export interface CopyableFieldProps {
|
|||
url?: string
|
||||
}
|
||||
|
||||
const log = new Logger('CopyableField')
|
||||
|
||||
export const CopyableField: React.FC<CopyableFieldProps> = ({ content, nativeShareButton, url }) => {
|
||||
useTranslation()
|
||||
const copyButton = useRef<HTMLButtonElement>(null)
|
||||
|
@ -27,8 +30,8 @@ export const CopyableField: React.FC<CopyableFieldProps> = ({ content, nativeSha
|
|||
text: content,
|
||||
url: url
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Native sharing failed: ', err)
|
||||
.catch((error) => {
|
||||
log.error('Native sharing failed', error)
|
||||
})
|
||||
}, [content, url])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue