Skip to content

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Sep 12, 2025

  • Created VaadinPluginLog utility class for centralized logging
  • Replaced all System.out.println with appropriate log levels (info/debug)
  • Replaced all System.err.println with VaadinPluginLog.error
  • Replaced e.printStackTrace() with proper exception logging
  • Uses Eclipse ILog framework for proper plugin integration
  • Maintains same message content with appropriate severity levels

- Created VaadinPluginLog utility class for centralized logging
- Replaced all System.out.println with appropriate log levels (info/debug)
- Replaced all System.err.println with VaadinPluginLog.error
- Replaced e.printStackTrace() with proper exception logging
- Uses Eclipse ILog framework for proper plugin integration
- Debug messages only shown when Eclipse is in debug mode
- Maintains same message content with appropriate severity levels
@MarcinVaadin
Copy link
Member

Why not use ILog directly?

ILog.get().info("Starting");
ILog.get().error("Generating template failed!", e);
ILog.get().warn("Creating a warning..");

according to https://www.vogella.com/tutorials/EclipseLogging/article.html each plugin should have own logger.

- Changed PLUGIN_ID from 'com.vaadin.eclipse.plugin' to 'vaadin-eclipse-plugin'
- Added fallback using FrameworkUtil.getBundle() if direct lookup fails
- This fixes the issue where Platform.getBundle() was returning null
- Logging now works correctly as seen in test output
@Artur-
Copy link
Member Author

Artur- commented Sep 12, 2025

You're absolutely right! The ILog.get() approach is much simpler and is the modern Eclipse way since Eclipse 2021-03.

- Replaced complex bundle lookup with simple ILog.get() calls
- Available since Eclipse 2021-03, automatically uses calling class's bundle
- Much cleaner and simpler code
- Each plugin gets its own logger automatically
- Follows modern Eclipse best practices per vogella.com guidelines
@Artur-
Copy link
Member Author

Artur- commented Sep 12, 2025

Updated

@MarcinVaadin
Copy link
Member

Do we need static logger class? I meant that we can use ILog.get() everywhere in code instead of VaadinPluginLog...

@Artur-
Copy link
Member Author

Artur- commented Sep 12, 2025

We can, but ILog.get() does not have any debug method which is why there is a logger class

@MarcinVaadin
Copy link
Member

Indeed, no debug :-/ so let's keep as proposed.

@Artur- Artur- merged commit 0250273 into main Sep 12, 2025
2 checks passed
@Artur- Artur- deleted the logger branch September 12, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants