How to Fix – The plugin generated xxx characters of unexpected output during activation?

After activation plugin, it shows– The plugin generated 362 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

Let’s see to find the error.

01. creates log file error_activation.txt in your plugin folder.
02. Add this code to your plugin main file –

03. Activate the plugin and see the error in the text file.