feat: http与ws共站支持热重载

This commit is contained in:
挂神 committed 2024-07-24 13:14:35 +08:00
1 parent c9a1e6e748
commit 17ee49937c
4 files changed
+62 -37

No files matched your search

+4 -2
View File
@@ -91,8 +91,10 @@ export function enableConsoleLog(enable: boolean) {
function formatMsg(msg: any[]) {
let logMsg = '';
for (const msgItem of msg) {
// 判断是否是对象
if (typeof msgItem === 'object') {
if (msgItem instanceof Error) { // 判断是否是错误
logMsg += msgItem.stack + ' ';
continue;
} else if (typeof msgItem === 'object') { // 判断是否是对象
const obj = JSON.parse(JSON.stringify(msgItem, null, 2));
logMsg += JSON.stringify(truncateString(obj)) + ' ';
continue;