-
Notifications
You must be signed in to change notification settings - Fork 20
Logging
You can write messages to the log in the admin ui of companion by calling this.log('info', 'Your message')
It is required that the message (2nd parameter) is a string, if it is not a string it will be converted to one, which can result in poor output if it was an object.
There are multiple levels that can be passed:
- 'error' Use this when something went wrong, and you want to tell the user about it
- 'warning' Use this when something a little wrong happened, but it shouldn't impact anything
- 'info' Use this when you want to tell the user some information
- Perhaps once connected you want to log the version of what you have connected to
- 'debug' Use this to provide yourself extra information to aid in debugging
Note: The 'debug' level is currently always shown to the user, but this is expected to change so that it has to be enabled first. Feel free to be fairly noisy in how you use this, but remember that each message you write does have a cost.
You can also use console.log
and similar functions. These are currently treated as an extra 'verbose' method that is only shown during development when companion is launched in the correct way. You should try to avoid using these.
Getting Started
- Home
- Module development 101
- Git crashcourse
- Upgrading a module built for Companion 2.x
- Companion module library versioning
- Releasing your module
Development
- File Structure
- manifest.json
- Logging
- Module debugging
- Module packaging
- Actions
- Feedbacks
- Presets
- Input Field Types
- Module configuration
- Upgrade scripts
- Variables
- HTTP Handler
Code quality
Advanced functionality