> For the complete documentation index, see [llms.txt](https://developer.eagle.cool/plugin-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.eagle.cool/plugin-api/ja-jp/api/log.md).

# log（ログ）

{% hint style="info" %}
Eagle の[ソフトウェアログ](https://docs-cn.eagle.cool/article/92-how-do-i-get-the-error-log)の取得方法については、こちらをクリックしてください。
{% endhint %}

```javascript
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"
```

***

#### メソッド <a href="#z1a5y" id="z1a5y"></a>

## debug(obj) <a href="#haugb" id="haugb"></a>

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

* `obj` Object - 記録したい内容。`Object`、`String`、`Array` など様々な形式が使用できる。

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

***

## info(obj) <a href="#qxf3f" id="qxf3f"></a>

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

* `obj` Object - 記録したい内容。`Object`、`String`、`Array` など様々な形式が使用できる。

***

## warn(obj) <a href="#ctpju" id="ctpju"></a>

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

* `obj` Object - 記録したい内容。`Object`、`String`、`Array` など様々な形式が使用できる。

***

## error(obj) <a href="#mo6j1" id="mo6j1"></a>

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

* `obj` Object - 記録したい内容。`Object`、`String`、`Array` など様々な形式が使用できる。

```javascript
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"
```

***
