Skip to content

[BUG] Can't set log level #265

Closed
Closed
@AntonRatnick

Description

@AntonRatnick

Is there an existing issue for this?

  • I have searched the existing issues

SDK Version

3.1.1

Current Behavior

Setting log level to Error, don't reduce amount of warnings and info logs in console

Expected Behavior

If log level == Error no info or warning logs appear in console.

Steps To Reproduce

  1. Changing log level to Error, the way described in the documentation not changing console output
  2. Passing log level as part of config to createInstance also not working

React Framework

No response

Browsers impacted

No response

Link

  1. https://github.com/optimizely/react-sdk/blob/master/src/logger.tsx#L19 Here we create logger instance and pass only prefix.
  2. https://github.com/optimizely/javascript-sdk/blob/4909efb74335b754592ddf6e8415047fc0bf3e7b/lib/modules/logging/logger.ts#L99
    If I am not mistaken this is the logger we creating, without any arguments beside the prefix.
  3. import { logger } from './logger';

    Here we import created logger, and use it.
  4. The logger instance created for React SDK is not exported, so changing log level on created instance also not possible.

Logs

No response

Severity

No response

Workaround/Solution

No response

Recent Change

No response

Conflicts

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions