Langfuse JS/TS SDKs
    Preparing search index...

    A configurable logger class that supports different log levels and formatting.

    const logger = new Logger({ level: LogLevel.DEBUG, prefix: 'Langfuse SDK' });
    logger.info('Application started');
    logger.error('An error occurred', error);
    Index

    Constructors

    • Creates a new Logger instance.

      Parameters

      • config: LoggerConfig = ...

        Configuration options for the logger

      Returns Logger

    Methods

    • Logs a debug message.

      Parameters

      • message: string

        The debug message to log

      • ...args: unknown[]

        Additional arguments to pass to console.debug

      Returns void

    • Logs an error message.

      Parameters

      • message: string

        The error message to log

      • ...args: unknown[]

        Additional arguments to pass to console.error

      Returns void

    • Gets the current log level.

      Returns LogLevel

      The current log level

    • Logs an informational message.

      Parameters

      • message: string

        The info message to log

      • ...args: unknown[]

        Additional arguments to pass to console.info

      Returns void

    • Sets the minimum log level.

      Parameters

      Returns void

    • Logs a warning message.

      Parameters

      • message: string

        The warning message to log

      • ...args: unknown[]

        Additional arguments to pass to console.warn

      Returns void