@webex/plugin-logger

Logging plugin for the Cisco Webex JS SDK.

Usage no npm install needed!

<script type="module">
  import webexPluginLogger from 'https://cdn.skypack.dev/@webex/plugin-logger';
</script>

README

@webex/plugin-logger

standard-readme compliant

Logging plugin for the Cisco Webex JS SDK.

Install

npm install --save @webex/plugin-logger

Usage

This is a plugin for the Cisco Webex JS SDK . Please see our developer portal and the API docs for full details.

const Webex = require('webex');
const webex = Webex.init();

webex.logger.info('Hello World'); // => wx-js-sdk Hello World

Log Levels

This logger plugin supports different logging levels to control what gets output to the user's console:

  • silent
    • Nothing prints to the console.
  • error [DEFAULT]
    • Error messages thrown by exceptions. This level is meant for the developer and end user to help with troubleshooting.
    • Example: Unable to connect to websocket on port 4343
  • warn
    • Warning messages meant to help guide developers away from potential errors.
    • Example: The usage of person email has been deprecated
  • log
    • General output of logging messages.
    • Example: Websocket connected on port 4343
  • info
    • More detailed logging of SDK information.
    • Example: Network status changed from DISCONNECTED to ONLINE
  • debug
    • Developer specific information, helpful with debugging issues.
    • Example: Network packet received, contents: {data}
  • trace
    • Prints the stack trace of the current call path.

Level Control

The developer can control what level gets printed by setting the environment variable: WEBEX_LOG_LEVEL.

These variables can be set on the command line or in the .env file:

WEBEX_LOG_LEVEL="debug" npm start
# .env file
WEBEX_LOG_LEVEL=debug

Maintainers

This package is maintained by Cisco Webex for Developers.

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

License

© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.