Closed peterlaws closed 8 years ago
I'm not really sure what the issue is here? It uses: https://github.com/php-fig/log as the log interface if that's what you're wondering about?
Please explain the issue at hand here?
Where does it say you need to download that, from a n00b respective, except within the About section as a link.
Composer will take care of that for you :) Just use composer install and everything will be automagically handled for you :)
I don't use composer though :)
Also, what is with the 'vendor/autoload.php'? I see no such file, only the 'Logger.php' file, so had to DIY include_once in the correct order.
I'd highly suggest you start using composer in that case. It takes care of loading all the dependencies and creating the vendor/autoload.php file for you.
Composer is a pretty wide spread tool within PHP development so you're going to encounter it in other places as well so you might as well start learning. Just do some reading on: https://getcomposer.org/
@peterlaws It's pretty common to use 3rd party packages now (in this case, it's not even a package, but an interface nearly every logging lib implements). Dependencies are no longer the exception, but the norm. That goes for nearly every other language too: ruby, python, javascript, yada yada. They each have their own packages and package managers.
If you're interested in the older, standalone version of KLogger, it's at: https://github.com/katzgrau/KLogger/releases/tag/0.2.0
Why isn't this writing to the file?
function logging($level = 'DEBUG') { $path = '/blah/'; $level = "Psr\Log\LogLevel::".$level; $options = array('dateFormat' => 'd-m-Y G:i:s.u', 'filename' => 'system.log'); $logger = new Katzgrau\KLogger\Logger($path, $level, $options); $logger->error('Test'); return $logger; }
There could be other reasons, but two obvious ones:
$level = constant("Psr\Log\LogLevel::".$level);
/blah/
actually exist? Seems unlikely, unless it was just for example purposes.By the way, that first mistake should have generated at least a PHP notice..
Anyway, I don't want to be rude, but these aren't KLogger issues - just issues with knowledge of PHP. Questions like this are probably better addressed on a PHP forum or IRC chat.
Where does it say this class uses other classes? Nowhere