Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@optimizely/js-sdk-logging

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@optimizely/js-sdk-logging

Optimizely Full Stack Core Logging

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115K
decreased by-12.98%
Maintainers
1
Weekly downloads
 
Created

What is @optimizely/js-sdk-logging?

@optimizely/js-sdk-logging is a logging utility for the Optimizely JavaScript SDK. It provides a way to log messages with different levels of severity and can be integrated with various logging frameworks.

What are @optimizely/js-sdk-logging's main functionalities?

Basic Logging

This feature allows you to create a logger and log messages with different severity levels such as info and error.

const logging = require('@optimizely/js-sdk-logging');
const logger = logging.getLogger('my-logger');
logger.info('This is an info message');
logger.error('This is an error message');

Custom Log Levels

This feature allows you to set custom log levels for your logger, enabling more granular control over what gets logged.

const logging = require('@optimizely/js-sdk-logging');
const logger = logging.getLogger('my-logger');
logger.setLogLevel(logging.LogLevel.DEBUG);
logger.debug('This is a debug message');

Integrating with External Logging Frameworks

This feature allows you to integrate @optimizely/js-sdk-logging with external logging frameworks like Winston, enabling you to leverage their advanced logging capabilities.

const logging = require('@optimizely/js-sdk-logging');
const winston = require('winston');
const logger = logging.getLogger('my-logger');
const winstonLogger = winston.createLogger({
  level: 'info',
  transports: [
    new winston.transports.Console()
  ]
});
logger.addLogHandler((logEvent) => {
  winstonLogger.log({
    level: logEvent.level,
    message: logEvent.message
  });
});
logger.info('This message will be logged by Winston');

Other packages similar to @optimizely/js-sdk-logging

Keywords

FAQs

Package last updated on 13 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc