Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.

Home Page:http://lyften.com/projects/laravel-geoip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined method reference...

PhoenixPeca opened this issue · comments

Hi,

I would just like to point out a reference to a method that does not (or no longer) exists..

$log->addError($e);

image

Possible fix: Seldaek/monolog@d686f25

This is because addError method no longer exists in Monolog v. 2.0.
Maybe some major upgrade in laravel-geoip is needed!

@Torann

Correct me if I'm wrong, but as I can see, the only usage of monolog in this repo is found in these lines:

laravel-geoip/src/GeoIP.php

Lines 162 to 164 in dc3c4fc

$log = new Logger('geoip');
$log->pushHandler(new StreamHandler(storage_path('logs/geoip.log'), Logger::ERROR));
$log->addError($e);

so, i dont think a major upgrade is needed.. I have made a PR already for this: #153

@PhoenixPeca You're correct

Looks like addError() just needs to be changed to error().

I'm also 100% fine with dropping the logger from here. I never use it.

LOL I just saw that you made the changes and put up a PR @PhoenixPeca. I'll merge it now 👍

Hold up. This change is breaking. I'll make a comment on the PR for a fix to prevent this

Ok. I just looked, v1.x of Monolog also has the method error, so this will not break anything. Merging now :-)