log(ログ)

Eagle ソフトウェアのログに特定の情報を記録し、開発中のデバッグやエラーの除去に役立てます。

Eagle のソフトウェアログの取得方法については、こちらをクリックしてください。

eagle.log.debug('debug message from plugin');
eagle.log.info('info message from plugin');
eagle.log.warn('warn message from plugin');
eagle.log.error('error message from plugin');

// [13:19:39.845] [debug] [plugin] "debug message from plugin"
// [13:19:39.845] [info] [plugin] "info message from plugin"
// [13:19:39.845] [warn] [plugin] "warn message from plugin"
// [13:19:39.845] [error] [plugin] "error message from plugin"

メソッド

debug(obj)

ソフトウェアログにデバッグタイプの内容を記録する

  • obj Object - 記録したい内容。ObjectStringArray など様々な形式が使用できる。

eagle.log.debug(obj);
eagle.log.debug(array);
eagle.log.debug('error message from plugin');

info(obj)

ソフトウェアログに情報タイプの内容を記録する

  • obj Object - 記録したい内容。ObjectStringArray など様々な形式が使用できる。


warn(obj)

ソフトウェアログに警告タイプの内容を記録する

  • obj Object - 記録したい内容。ObjectStringArray など様々な形式が使用できる。


error(obj)

ソフトウェアログにエラータイプの内容を記録する

  • obj Object - 記録したい内容。ObjectStringArray など様々な形式が使用できる。

try {
    let a = {};
    a.b.c = 'test';
}
catch (err) {
    eagle.log.error('error message from plugin');
    eagle.log.error(err.stack || err);
}

// [13:23:24.191] [error] [plugin] "error message from plugin"
// [13:23:24.191] [error] [plugin] "TypeError: Cannot set properties of undefined (setting 'c')\n    at <anonymous>:3:11"

最后更新于