<?php
if (!defined('ABSPATH')) exit;

class OpsGate_Logger {
  public static function init(){
    // reserved for future hooks
  }
  public static function log($msg){
    $upload = wp_upload_dir();
    $dir = trailingslashit($upload['basedir']).'opsgate';
    if (!file_exists($dir)) wp_mkdir_p($dir);
    $line = '['.date('Y-m-d H:i:s').'] '.$msg.PHP_EOL;
    file_put_contents($dir.'/opsgate.log', $line, FILE_APPEND);
  }
}
