catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

protected $logging = false; to public $logging = false; #610

Closed km3945 closed 6 years ago

km3945 commented 7 years ago

I just want to record all SQL at DEBUG.

protected $logging = false; to: public $logging = false;


function getAll($debug=false){
    $this->db->logging = $debug;

    $this->db->select('test');
    $this->db->select('test1');
    $this->db->select('test2');

    if($debug){
        $sql=$this->db->log();
        die('<pre>'.htmlspecialchars(print_r(get_defined_vars(), true)).'</pre>');
    }
}
catfan commented 7 years ago

In what kind of situation you need to enable and disable logging while running the code and don't not make logging enable / disable on Medoo initialization?

Andrews54757 commented 7 years ago

@km3945 If you want that, you can change it in your own copy too. No need to edit the main repo