BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
287 stars 101 forks source link

feat(SDK-2217): add logger with loglevel support #1005

Open JagadeeshKaricherla-branch opened 3 months ago

JagadeeshKaricherla-branch commented 3 months ago

add logger with loglevel support

Pull Request Template

Description

The logger supports different log levels, enabling developers to control the verbosity of log messages based on their requirements.

Logger Implementation

The Web SDK Logger is implemented as part of the Web SDK package. It provides methods for setting the log level and logging messages at various levels of severity.

Log Levels

The following log levels are supported:

Usage

Setting Log Level

set the logLevel method inside init options

branch.init(
    branch_key,
    options: {
        logLevel: 'verbose',
        timeout: 500,
        retry_delay: 400
    },
    callback(err, data),
);

Fixes # (issue) : SDK-2217

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

JS Budget Check

Please mention the size in kb before abd after this PR

Files Before After
dist/build.js.
dist/build.min.js

Checklist:

Mentions:

List the person or team responsible for reviewing proposed changes.

cc @BranchMetrics/saas-sdk-devs for visibility.

github-actions[bot] commented 2 months ago

Test Results

  1 files  ± 0    1 suites  ±0   1m 2s :stopwatch: +5s 177 tests +18  170 :white_check_mark: +18  7 :zzz: ±0  0 :x: ±0  180 runs  +18  173 :white_check_mark: +18  7 :zzz: ±0  0 :x: ±0 

Results for commit c59ade5c. ± Comparison against base commit e2b3837e.

:recycle: This comment has been updated with latest results.