reasonableframework/system/logger.php

35 lines
721 B
PHP
Raw Normal View History

<?php
/**
* @file logger.php
* @date 2018-05-27
* @author Go Namhyeon <gnh1201@gmail.com>
2018-05-26 17:35:32 +00:00
* @brief Logger module for ReasonableFramework
*/
2019-02-26 05:40:03 +00:00
if(!check_function_exists("write_visit_log")) {
function write_visit_log() {
2018-09-28 06:38:18 +00:00
$fw = false;
if(loadHelper("networktool")) {
$data = "\r\n" . json_encode(get_network_event());
$fw = write_storage_file($data, array(
"storage_type" => "logs",
2018-09-29 21:18:28 +00:00
"filename" => "network.log",
2018-09-28 06:38:18 +00:00
"mode" => "a"
));
}
return $fw;
}
2018-09-29 21:18:44 +00:00
}
2018-09-29 21:14:51 +00:00
2019-02-26 05:40:03 +00:00
if(!check_function_exists("write_common_log")) {
2018-09-29 21:14:51 +00:00
function write_common_log($msg) {
$msg = "\r\n" . $msg;
return write_storage_file($msg, array(
"storage_type" => "logs",
"filename" => "common.log",
2018-09-29 21:18:55 +00:00
"mode" => "a"
2018-09-29 21:14:51 +00:00
));
}
}