UNPKG

@devgalena/react-use-logger

Version:

`react-use-logger` is a React hook to log messages. It also contains a function `useLogger` and a class `LoggingContextProvider` to set the logging levels of the library / application

19 lines (18 loc) 566 B
/** * LoggingLevel represents the various logging levels at which you can log fine-grained logs. * It can be turned on/off based on the configuring `LoggingContextProvider`. * @example * <LoggingContextProvider level={LoggingLevel.Info}> * <MyComponentUseLogger /> * </LoggingContextProvider> */ export declare enum LoggingLevel { Debug = 0, Info = 1, Warning = 2, Error = 3 } /** * Type of Function that renders the given string at the given `LoggingLevel` */ export type RenderLoggerFnType = (level: LoggingLevel, s: string) => void;