tboothman / imdbphp

PHP library for retrieving film and tv information from IMDb
251 stars 84 forks source link

debug text [Cache] Purging old cache entries should appear later #245

Closed jcvignoli closed 3 years ago

jcvignoli commented 3 years ago

Hi,

I'm using imdbphp library for a wordpress plugin, Lumière and the GIT

Thanks so much tboothman for continuing Ozzy project. You improved it a lot, congrat!

First, please not I'm not an experienced developper, I might face newbie issues from time to time.

I'm trying to implement a proper debug in my plugin. However, when activating imdbphp debugging, a debug message is returned before the html declaration: [Cache] Purging old cache entries

This message, which is incorrect html (not an important issue since it's a debugging message), breaks the layout as it is thrown before the text.

I tried to edit logger.php and cache.php looking for a solution, but I failed.

Is there anything that could be done?

Thanks!

tboothman commented 3 years ago

This might be slightly helpful https://github.com/tboothman/imdbphp#replacing-the-default-logger-which-echos-coloured-html-and-is-disabled-by-default The logger built into imdbphp is pretty useless, which is why it's disabled. You can replace it with any psr-3 logger as the readme says. There's a bunch of them on packagist https://packagist.org/providers/psr/log-implementation https://www.php-fig.org/psr/psr-3/ You could just copy/paste the imdbphp logger to create your own logger and change what's in the log method.

jcvignoli commented 3 years ago

I thank you very much. I've been able to fix my issue!

Thanks also for maintaining this great library, much appreciated.