Components log all errors to the browser’s console by default. You can customize this behavior using the LogProvider component.

For example, if your app contains a Counter component, you can configure it to only log errors like this:

import { Counter, LogProvider, LogLevel } from "@propeldata/ui-kit";

function LoggerComponent() {
  return (
    <LogProvider level={LogLevel.Error}>
      <Counter />
    </LogProvider>
  );
}

The LogProvider component allows you to control logging behavior for your components. It works by:

  1. Using React’s context to share logging settings with child components
  2. Allowing you to specify which components to log by wrapping them
  3. Supporting different log levels:
    • error - Only show errors
    • warn - Show warnings and errors
    • info - Show info messages, warnings and errors
    • debug - Show all log messages
    • off - Disable all logging