Socket
Socket
Sign inDemoInstall

@wdio/logger

Package Overview
Dependencies
5
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @wdio/logger

A helper utility for logging of WebdriverIO packages


Version published
Maintainers
3
Install size
749 kB
Created

Package description

What is @wdio/logger?

The @wdio/logger package is a utility used within the WebdriverIO testing framework to facilitate logging. It allows developers to create namespaced loggers that can be used to output messages to the console or to files, depending on the configuration. It is designed to work seamlessly with the WebdriverIO ecosystem but can also be used independently for logging purposes in Node.js applications.

What are @wdio/logger's main functionalities?

Creating a Logger Instance

This feature allows you to create a new logger instance with a specific namespace. You can then use this instance to log messages at different levels, such as info, warn, error, etc.

const logger = require('@wdio/logger').default('my-logger');
logger.info('This is an info message.');

Setting Log Levels

This feature allows you to set the log level for a specific logger instance. Messages below the set level will not be logged.

const logger = require('@wdio/logger').default('my-logger');
logger.setLevel('info');
logger.info('This will be logged.');
logger.debug('This will not be logged.');

Logging Messages

This feature is used to log messages at different severity levels. The available methods are info, warn, error, and others, each corresponding to a level of importance.

const logger = require('@wdio/logger').default('my-logger');
logger.info('Informational message');
logger.warn('Warning message');
logger.error('Error message');

Other packages similar to @wdio/logger

Changelog

Source

v8.0.0 (2022-12-01)

:boom: Breaking Change
  • Drop Node.js v12, v13 and v14 Support
  • Transition code base from CommonJS to ESM
    • This should not affect WebdriverIO users as you can use the testrunner, as well as webdriver, devtools and webdriverio NPM packages in a CJS environment
    • We still mark this as breaking as we can't gurantee that all (untested) functionality will behave the same due to all rewrites done to the code base
  • Removal of @wdio/sync which we deprecated in v7
  • WebdriverIO types are now accessible through @wdio/globals/types instead of webdriverio/async
  • Removal of browser.config
    • Please use browser.options instead
    • This will stop support assigning custom properties to the wdio.conf.js which we disadvise you to do, instead either assign it as part of a custom capability, e.g. custom:options (note the : in it, read more on custom capabilities in the WebDriver spec) or via `@wdio/shared-store-service
  • discontinued support for tsconfig-paths
:rocket: New Feature
  • New runner plugin called @wdio/browser-runner allows you to run unit and component tests in the browser
  • Access WebdriverIO primitives through the new @wdio/globals package
  • New Action API
:house: Internal
  • Update required Node.js version for development to v18.12.1
  • Migrate unit tests from Jest to Vitest
:nail_care: Polish
  • Improvements on configuration wizard and create-wdio
    • It now detects whether your projects uses ESM or CJS and creates example files accordingly
    • It now finds the project root and sets up the project relative to it
    • Adds support for browser runner selection
:memo: Documentation
  • Little design tweaks to the hero section on the main page
  • Added new section for component testing
  • Added new API section for browser, element, mock objects, modules and environment variables

Readme

Source

WDIO Logger Utility

A helper utility for logging of WebdriverIO packages

This package is used across all WebdriverIO packages to log information using the loglevel package. It can also be used for any other arbitrary Node.js project.

Install

To install the package just call

npm install @wdio/logger

or when adding it to a WebdriverIO subpackage:

lerna add @wdio/logger --scope <subpackage>

Usage

The package exposes a logger function that you can use to register an instance for your scoped package:

import logger from '@wdio/logger'

const log = logger('myPackage')
log.info('some logs')

For more info see loglevel package on NPM.

Keywords

FAQs

Last updated on 01 Dec 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc