mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Chore: Mobile tests: Hide debug logging (#10977)
This commit is contained in:
parent
2f7b2fb948
commit
2a2dd96c02
@ -1,5 +1,6 @@
|
||||
import { useCallback } from 'react';
|
||||
import shared from '@joplin/lib/components/shared/note-screen-shared';
|
||||
import Logger from '@joplin/utils/Logger';
|
||||
|
||||
export type HandleMessageCallback = (message: string)=> void;
|
||||
export type OnMarkForDownloadCallback = (resource: { resourceId: string })=> void;
|
||||
@ -12,6 +13,8 @@ interface MessageCallbacks {
|
||||
onCheckboxChange: HandleMessageCallback;
|
||||
}
|
||||
|
||||
const logger = Logger.create('useOnMessage');
|
||||
|
||||
export default function useOnMessage(
|
||||
noteBody: string,
|
||||
callbacks: MessageCallbacks,
|
||||
@ -29,10 +32,10 @@ export default function useOnMessage(
|
||||
return useCallback((msg: string) => {
|
||||
const isScrollMessage = msg.startsWith('onscroll:');
|
||||
|
||||
// Scroll messages are very frequent so we avoid logging them.
|
||||
// Scroll messages are very frequent so we avoid logging them, even
|
||||
// in debug mode
|
||||
if (!isScrollMessage) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info('Got IPC message: ', msg);
|
||||
logger.debug('Got IPC message: ', msg);
|
||||
}
|
||||
|
||||
if (msg.indexOf('checkboxclick:') === 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user