Skip to content

Commit

Permalink
feat: 更新stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
bingcool committed Jun 10, 2023
1 parent fcacb76 commit 439a9f8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
29 changes: 19 additions & 10 deletions Test/Config/config-dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,33 @@
'log' => function($name) {
$logger = new \Swoolefy\Util\Log($name);
$logger->setChannel('application');
if(isWorkerService()) {
$logPath = LOG_PATH.'/worker.log';
if (isScriptService()) {
$logPath = LOG_PATH.'/script.log';
}
$logger->setLogFilePath($logPath);
return $logger;
if(isDaemonService()) {
$logFilePath = LOG_PATH.'/daemon.log';
}else if (isScriptService()) {
$logFilePath = LOG_PATH.'/script.log';
}else if (isCronService()) {
$logFilePath = LOG_PATH.'/cron.log';
} else {
$logger->setLogFilePath(LOG_PATH.'/runtime.log');
return $logger;
$logFilePath = LOG_PATH.'/runtime.log';
}
$logger->setLogFilePath($logFilePath);
return $logger;
},

// 系统捕捉异常错误日志
'error_log' => function($name) {
$logger = new \Swoolefy\Util\Log($name);
$logger->setChannel('application');
$logger->setLogFilePath(LOG_PATH.'/error.log');
if(isDaemonService()) {
$logFilePath = LOG_PATH.'/daemon_error.log';
}else if (isScriptService()) {
$logFilePath = LOG_PATH.'/script_error.log';
}else if (isCronService()) {
$logFilePath = LOG_PATH.'/cron_error.log';
} else {
$logFilePath = LOG_PATH.'/error.log';
}
$logger->setLogFilePath($logFilePath);
return $logger;
},

Expand Down
24 changes: 21 additions & 3 deletions swoolefy
Original file line number Diff line number Diff line change
Expand Up @@ -1094,17 +1094,35 @@ return [
'log' => function(\$name) {
\$logger = new \Swoolefy\Util\Log(\$name);
\$logger->setChannel('application');
\$logger->setLogFilePath(LOG_PATH.'/runtime.log');
if(isDaemonService()) {
\$logFilePath = LOG_PATH.'/daemon.log';
}else if (isScriptService()) {
\$logFilePath = LOG_PATH.'/script.log';
}else if (isCronService()) {
\$logFilePath = LOG_PATH.'/cron.log';
} else {
\$logFilePath = LOG_PATH.'/runtime.log';
}
\$logger->setLogFilePath(\$logFilePath);
return \$logger;
},
// 系统捕捉异常错误日志
'error_log' => function(\$name) {
\$logger = new \Swoolefy\Util\Log(\$name);
\$logger->setChannel('application');
\$logger->setLogFilePath(LOG_PATH.'/error.log');
if(isDaemonService()) {
\$logFilePath = LOG_PATH.'/daemon_error.log';
}else if (isScriptService()) {
\$logFilePath = LOG_PATH.'/script_error.log';
}else if (isCronService()) {
\$logFilePath = LOG_PATH.'/cron_error.log';
} else {
\$logFilePath = LOG_PATH.'/error.log';
}
\$logger->setLogFilePath(\$logFilePath);
return \$logger;
},
}
]
];
Expand Down

0 comments on commit 439a9f8

Please sign in to comment.