Create a namespaced debug logger.
The namespace for this logger (e.g., 'hiyve:client-provider')
A debug logger instance
Creates a logger that prefixes all messages with the namespace. Logging is conditional based on the global debug configuration.
Basic usage:
import { createDebugLogger } from '@hiyve/utilities';const debug = createDebugLogger('hiyve:my-component');debug.log('Component mounted');debug.warn('Deprecated prop used');debug.error('Failed to load data', error); Copy
import { createDebugLogger } from '@hiyve/utilities';const debug = createDebugLogger('hiyve:my-component');debug.log('Component mounted');debug.warn('Deprecated prop used');debug.error('Failed to load data', error);
In a React component:
import { createDebugLogger } from '@hiyve/utilities';const debug = createDebugLogger('hiyve:video-grid');function VideoGrid({ participants }) { useEffect(() => { debug.log('Participants updated:', participants.length); }, [participants]); // ...} Copy
import { createDebugLogger } from '@hiyve/utilities';const debug = createDebugLogger('hiyve:video-grid');function VideoGrid({ participants }) { useEffect(() => { debug.log('Participants updated:', participants.length); }, [participants]); // ...}
Create a namespaced debug logger.