-
Notifications
You must be signed in to change notification settings - Fork 18
Logging
Companion has a few different locations for viewing logs:
- Admin GUI
- Available in the web GUI, under the "Log" Panel
- Log Files
- The file location varies based on the operating system, but can be located by clicking the Companion shortcut or menubar icon > "Show config folder" and then navigating to the log folder
- Module Log
- Accessible for each module on the "Connections" panel > 3 dot menu > View logs
- Accessible for each module on the "Connections" panel > 3 dot menu > View logs
You can write messages to the Companion log by calling this.log('info', 'Your message')
, where the first parameter is the level associated with the log, and the second parameter is the log message.
It is required that the message is a string. If the message is not a string it will be converted to one, which can result in an unhelpful output if it contains an object or other non-string value.
There are multiple log levels that can be passed:
Level | Use Case | Visibility |
---|---|---|
'error' | Fatal or blocking errors that impact the functionality or stability of the module | Admin GUI, Log File, Module Log |
'warning' | Minor issues or a misconfiguration that does not impact the overall functionality of the module | Admin GUI, Log File, Module Log |
'info' | General information that could be helpful, such as emitting the software version of the connected device upon connection | Admin GUI, Log File, Module Log |
'debug' | Provide extra information to aid in debugging | Module Log |
You can also use console.log
and similar functions. These are currently treated as an extra 'verbose' method. They are available in the Module Log, similar to debug messages. You should try to avoid using these outside of a development environment.
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