1. Go to this page and download the library: Download protechstudio/oplogger library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
...
use Protechstudio\Oplogger\Repositories\LogRepositoryContract;
class CustomRepository implements LogRepositoryContract
{
//your custom repository implementation
}
...
use Protechstudio\Oplogger\Oplogger;
class FooController extends Controller
{
private $oplogger;
public function __construct(Oplogger $oplogger)
{
$this->oplogger = $oplogger;
}
public function bar()
{
$this->oplogger->write('test');
}
}
...
use Oplogger;
public function bar()
{
Oplogger::write('test');
}
'types' => [
'test' => 'Basic operation for testing purposes.',
'myoperation' => 'Has made %d operations using %s',
],
Oplogger::write('myoperation',[4,'parameters']);
// Result will be: 'Has made 4 operations using parameters'