feat: 添加多个字体图标、样式文件和配置文件
新增了多个字体图标文件(SVG格式),包括品牌图标和常规图标。添加了相关的样式文件(LESS和SCSS)用于管理图标样式。更新了配置文件如.gitignore、composer.json和.htaccess等。新增了开发者相关的PHP文件如logout.php。添加了项目规则文档和字体相关的样式文件。
This commit is contained in:
56
includes/logger.php
Normal file
56
includes/logger.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Logging utility for the application
|
||||
* Provides log_info() and log_error() functions
|
||||
*/
|
||||
|
||||
if (!function_exists('log_info')) {
|
||||
/**
|
||||
* Log informational message
|
||||
* @param string $message The message to log
|
||||
* @param string $file Optional file name where the log was called
|
||||
* @param int $line Optional line number where the log was called
|
||||
*/
|
||||
function log_info($message, $file = '', $line = 0) {
|
||||
$logFile = __DIR__ . '/../logs/app_' . date('Y-m-d') . '.log';
|
||||
|
||||
// Create logs directory if it doesn't exist
|
||||
if (!file_exists(dirname($logFile))) {
|
||||
mkdir(dirname($logFile), 0755, true);
|
||||
}
|
||||
|
||||
$prefix = '[' . date('Y-m-d H:i:s') . '] [INFO]';
|
||||
if (!empty($file) && $line > 0) {
|
||||
$prefix .= ' [' . basename($file) . ':' . $line . ']';
|
||||
}
|
||||
|
||||
$logMessage = $prefix . ' ' . $message . PHP_EOL;
|
||||
file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('log_error')) {
|
||||
/**
|
||||
* Log error message
|
||||
* @param string $message The error message to log
|
||||
* @param string $file Optional file name where the error occurred
|
||||
* @param int $line Optional line number where the error occurred
|
||||
*/
|
||||
function log_error($message, $file = '', $line = 0) {
|
||||
$logFile = __DIR__ . '/../logs/error_' . date('Y-m-d') . '.log';
|
||||
|
||||
// Create logs directory if it doesn't exist
|
||||
if (!file_exists(dirname($logFile))) {
|
||||
mkdir(dirname($logFile), 0755, true);
|
||||
}
|
||||
|
||||
$prefix = '[' . date('Y-m-d H:i:s') . '] [ERROR]';
|
||||
if (!empty($file) && $line > 0) {
|
||||
$prefix .= ' [' . basename($file) . ':' . $line . ']';
|
||||
}
|
||||
|
||||
$logMessage = $prefix . ' ' . $message . PHP_EOL;
|
||||
file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user