Skip to content

How to log

Sébastien Gallou edited this page Jun 24, 2016 · 3 revisions

To help debug your plugin, you can log.

Make plugin write log

Plugin standard outputs are redirected so that Yadoms can manage logs from plugins.

All log strings will be time stamped by Yadoms.

Strings written to standard output will be prefixed by "[INFORMATION]". Strings written to standard error output will be prefixed by "[ERROR]".

So for your plugin to log, you simply have to write to standard outputs. In C++, you can use std::cout and std::cerr (alternatively use printf in C). Don't forget the carriage return.

For example :

std::cout << "CFakePlugin is starting..." << std::endl;

will write string into the log file like :

2016/06/17 15:05:16 : [INFORMATION] CFakePlugin is starting...

Show plugin log

Plugin log is written on {YadomsBinaryFolder}\logs\plugins\{PluginInstanceId}\plugin.log, where {PluginInstanceId} is the ID of the instance using your plugin.

Yadoms web client is also able to display the log file (only in developer mode), from the plugin page in dashboard. You can active developer mode in yadoms.ini file.

Clone this wiki locally