<?
class Log
{
  static public function save_log( $message, $user_id = null )
  {
    global $mdb;
    $mdb -> insert( 'pp_log', [
      'message' => $message,
      'user_id' => $user_id ? $user_id : null,
      'date' => date( 'Y-m-d H:i:s' )
    ] );
  }
}