boboldehampsink / import

DEPRECATED - Import plugin for Craft CMS
MIT License
176 stars 28 forks source link

modifyImportRow hook does not honor Craft forced logging #138

Closed smockensturm closed 8 years ago

smockensturm commented 8 years ago

It's as simple as that. I would be grateful if anyone else could try and reproduce this.

function modifyImportRow($element, $map, $data)
{
    ImportHelperPlugin::log("Forced log from modifyImportRow method", LogLevel::Info, true);
}
boboldehampsink commented 8 years ago

Oh I have. It works fine in here.

importhelper.log

2016/09/14 14:14:45 [info] [plugin] [Forced] Forced log from modifyImportRow method
in /var/www/html/craft/app/etc/plugins/BasePlugin.php (65)
in /var/www/html/craft/plugins/importhelper/ImportHelperPlugin.php (46)
in /var/www/html/craft/app/services/PluginsService.php (582)
smockensturm commented 8 years ago

devMode false?

boboldehampsink commented 8 years ago

Confirmed. I did dive a bit deeper tho. When I try to force log from any "task" with devMode false it never shows up. I even injected some code in the TaskService where the steps are being ran.

Since my import plugin runs in a task, this also affects my plugin.

I'm cc'ing @takobell @brandonkelly for this.

angrybrad commented 8 years ago

Just tried to reproduce this with devMode off and a Craft task (ResaveAllElements) and the forced logs all came through fine:

2016/09/15 04:20:32 [info] [application] [Forced] Starting task ResaveAllElements that has a total of 6 steps.
2016/09/15 04:20:32 [info] [application] [Forced] Starting step 1 of 6 total steps.
2016/09/15 04:20:32 [info] [application] [Forced] Forced Log
2016/09/15 04:20:32 [info] [application] [Forced] Starting task ResaveElements that has a total of 0 steps.
2016/09/15 04:20:32 [info] [application] [Forced] Finished task 2 (ResaveElements).
2016/09/15 04:20:32 [info] [application] [Forced] Starting step 2 of 6 total steps.
2016/09/15 04:20:32 [info] [application] [Forced] Forced Log
...

Maybe something task specific? Regardless, I wouldn't put too much effort into this... the 3rd "force" param doesn't exist anymore in Craft 3.

boboldehampsink commented 8 years ago

@takobell that doesn't come through here either. Anyway, lets forget about it then.