Plugin API
English
English
  • Getting Started
    • Introduction
    • Your First Plugin
    • File Structure Overview
    • Plugin Types
      • Window
      • Background Service
      • Format Extension
      • Inspector
    • Debug Plugin
  • Distribution
    • Prepare Plugin
    • Package Plugin
    • Publish Plugin
    • Update Plugin
    • Developer Policies
    • Plugin Icon Template
  • Developer Guide
    • manifest.json Configuration
    • Retrieve Data
    • Modify Data
    • Access Local Files
    • Issue Network Requests
    • Using Node.js Native API
    • Using Third-Party Modules
    • Multilingual (i18n)
    • Frameless Window
  • API Reference
    • event
    • item
    • folder
    • tag
    • tagGroup
    • library
    • window
    • app
    • os
    • screen
    • notification
    • contextMenu
    • dialog
    • clipboard
    • drag
    • shell
    • log
  • Extra Moudle
    • FFmpeg
Powered by GitBook
On this page
  • debug(obj)
  • info(obj)
  • warn(obj)
  • error(obj)
  1. API Reference

log

Log specific information in Eagle software for debugging and troubleshooting during development.

PreviousshellNextFFmpeg

Last updated 2 years ago

Click here to see how to obtain 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"

Methods

debug(obj)

Log debug-type content to the software log

  • obj Object - The content to be recorded, can be Object, String, Array, and other formats

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

info(obj)

Log info-type content to the software log

  • obj Object - The content to be recorded, can be Object, String, Array, and other formats


warn(obj)

Log warn-type content to the software log

  • obj Object - The content to be recorded, can be Object, String, Array, and other formats


error(obj)

Log error-type content to the software log

  • obj Object - The content to be recorded, can be Object, String, Array, and other formats

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"

software logs