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
  • Window Plugin Debug
  • Debug Thumbnail Plugin
  • Debug Preview Plugin
  • Log System
  1. Getting Started

Debug Plugin

This article will provide a detailed explanation of effective methods for debugging and troubleshooting Eagle plugins.

PreviousInspectorNextPrepare Plugin

Last updated 10 months ago

Window Plugin Debug

After opening the plugin, press the F12 key to open the DevTools debugging tool.

The specific steps are as follows:

  1. Open the plugin you want to debug in Eagle, and press the F12 key to open DevTools.

  2. In DevTools, you can view the plugin's code and use breakpoints and debugging tools to debug the plugin's execution process.

  3. You can also use other tools in DevTools to view information about the plugin's performance, memory usage, etc.

Debug Thumbnail Plugin

The thumbnail plugin runs in the background, and the code is only executed when files are added or updated. If you want to debug the thumbnail function code, you can set the devTools property to true in the manifest.json file and set debugger breakpoints in the code, which can then be debugged using devTools.

Debug Preview Plugin

Add and select the file format you want to develop in Eagle, open the plugin panel, click on the plugin you're developing, and a separate preview window will open. You can press F12 to open DevTools for debugging.

Learn more: If you are unsure how to use DevTools, you can refer to the following learning resources:

Log System

Please note: The preview and thumbnail plugins currently do not support the log API.

A logging system is a tool used to record the running status of software, helping developers to locate and solve problems more quickly. The logging system records software error information, warning information, runtime information, etc., and can be used as a debugging tool. In a non-development environment, the logging system effectively helps developers identify the causes of problems and take measures to solve them.

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"

Google official documentation:

MDN Web documentation:

W3Schools tutorial:

Eagle Plugin API provides a to record plugin runtime information. This way, developers can record the plugin's running, warnings, errors, and other information in Eagle's software logs. By using this feature, developers can view this information by only providing a debug report to the user. While developing plugins, the logging feature helps developers to quickly locate and solve problems.

Learn More:

Click here to view Eagle's acquisition method.

https://developers.google.com/web/tools/chrome-devtools
https://developer.mozilla.org/zh-CN/docs/Tools
https://www.w3schools.com/js/js_debugging.asp
log functionality
Log - API Reference
software log
DevTools