Seme Log

The seme_log library is for logging some text or result into file log. Seme log will create and put new file seme.log in root project or in app/cache/seme.log depending directory access on your script.


How to use

First we have to loaded library by using library loaded:

$this->lib('seme_log');

You can put libary loader in constructor of controller or on each method in your controller.

Basic Usage

Seme Log only have one method called write for writting log into file log. Here is the example:

Class Product extends SENE_Controller{
  public function __construct(){
    $this->lib('seme_log');
  }
  public function index(){
    $this->seme_log->write("Produk::index called");
  }
}

And then this is the result if we open file seme.log

2019-08-06 10:22:22 - Produk::index called
2019-08-06 10:22:25 - Produk::index called

Advanced Result

If you used *nix Operating System, you can tail -f seme.log for realtime view log.