@@ -25,9 +25,9 @@ std::string ValueKindToString(const ValueKind& kind);
2525// 输出脚本调用堆栈,API名称,以及插件名
2626inline void LOG_ERROR_WITH_SCRIPT_INFO (std::string const & func = " " , std::string const & msg = " " ) {
2727 auto e = script::Exception (msg);
28- lse::getSelfPluginInstance ().getLogger ().error (" script::Exception: {0}\n {1}" , e.message (), e.stacktrace ());
29- lse::getSelfPluginInstance ().getLogger ().error (" In API: " + func);
30- lse::getSelfPluginInstance ().getLogger ().error (" In Plugin: " + getEngineOwnData ()->pluginName );
28+ lse::getSelfModInstance ().getLogger ().error (" script::Exception: {0}\n {1}" , e.message (), e.stacktrace ());
29+ lse::getSelfModInstance ().getLogger ().error (" In API: " + func);
30+ lse::getSelfModInstance ().getLogger ().error (" In Plugin: " + getEngineOwnData ()->pluginName );
3131}
3232
3333// 参数类型错误输出
@@ -60,12 +60,12 @@ inline void LOG_WRONG_ARGS_COUNT(std::string const& func = "") {
6060// 截获引擎异常
6161#define CATCH (LOG ) \
6262 catch (const Exception& e) { \
63- ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ()); \
63+ ll::error_utils::printException (e, lse::getSelfModInstance ().getLogger ()); \
6464 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
6565 return Local<Value>(); \
6666 } \
6767 catch (...) { \
68- ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ()); \
68+ ll::error_utils::printCurrentException (lse::getSelfModInstance ().getLogger ()); \
6969 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
7070 return Local<Value>(); \
7171 }
@@ -94,46 +94,46 @@ inline void LOG_WRONG_ARGS_COUNT(std::string const& func = "") {
9494// 截获引擎异常_Constructor
9595#define CATCH_C (LOG ) \
9696 catch (const Exception& e) { \
97- ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ()); \
97+ ll::error_utils::printException (e, lse::getSelfModInstance ().getLogger ()); \
9898 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
9999 return nullptr ; \
100100 } \
101101 catch (...) { \
102- ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ()); \
102+ ll::error_utils::printCurrentException (lse::getSelfModInstance ().getLogger ()); \
103103 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
104104 return nullptr ; \
105105 }
106106
107107// 截获引擎异常_Setter
108108#define CATCH_S (LOG ) \
109109 catch (const Exception& e) { \
110- ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ()); \
110+ ll::error_utils::printException (e, lse::getSelfModInstance ().getLogger ()); \
111111 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
112112 return ; \
113113 } \
114114 catch (...) { \
115- ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ()); \
115+ ll::error_utils::printCurrentException (lse::getSelfModInstance ().getLogger ()); \
116116 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
117117 return ; \
118118 }
119119
120120// 截获引擎异常_Constructor
121121#define CATCH_WITHOUT_RETURN (LOG ) \
122122 catch (const Exception& e) { \
123- ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ()); \
123+ ll::error_utils::printException (e, lse::getSelfModInstance ().getLogger ()); \
124124 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
125125 } \
126126 catch (...) { \
127- ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ()); \
127+ ll::error_utils::printCurrentException (lse::getSelfModInstance ().getLogger ()); \
128128 LOG_ERROR_WITH_SCRIPT_INFO (__FUNCTION__, LOG); \
129129 }
130130
131131// 截获回调函数异常
132132#define CATCH_IN_CALLBACK (callback ) \
133133 catch (const Exception& e) { \
134- ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ()); \
135- lse::getSelfPluginInstance ().getLogger ().error (std::string (" In callback for " ) + callback); \
136- lse::getSelfPluginInstance ().getLogger ().error (" In Plugin: " + getEngineOwnData ()->pluginName ); \
134+ ll::error_utils::printException (e, lse::getSelfModInstance ().getLogger ()); \
135+ lse::getSelfModInstance ().getLogger ().error (std::string (" In callback for " ) + callback); \
136+ lse::getSelfModInstance ().getLogger ().error (" In Plugin: " + getEngineOwnData ()->pluginName ); \
137137 }
138138
139139#else
@@ -222,7 +222,7 @@ struct EnumDefineBuilder {
222222 }
223223 return arr;
224224 } catch (const std::exception&) {
225- lse::getSelfPluginInstance ().getLogger ().error (" Error in " __FUNCTION__);
225+ lse::getSelfModInstance ().getLogger ().error (" Error in " __FUNCTION__);
226226 }
227227 return Local<Value>();
228228 }
@@ -235,7 +235,7 @@ struct EnumDefineBuilder {
235235 }
236236 return obj;
237237 } catch (const std::exception&) {
238- lse::getSelfPluginInstance ().getLogger ().error (" Error in " __FUNCTION__);
238+ lse::getSelfModInstance ().getLogger ().error (" Error in " __FUNCTION__);
239239 }
240240 return Local<Value>();
241241 }
@@ -250,7 +250,7 @@ struct EnumDefineBuilder {
250250 return String::newString (magic_enum::enum_name (static_cast <Type>(args[0 ].asNumber ().toInt32 ())));
251251 return Local<Value>();
252252 } catch (const std::exception&) {
253- lse::getSelfPluginInstance ().getLogger ().error (" Error in " __FUNCTION__);
253+ lse::getSelfModInstance ().getLogger ().error (" Error in " __FUNCTION__);
254254 }
255255 return Local<Value>();
256256 }
@@ -259,7 +259,7 @@ struct EnumDefineBuilder {
259259 try {
260260 return String::newString (typeid (Type).name () + 5 );
261261 } catch (const std::exception&) {
262- lse::getSelfPluginInstance ().getLogger ().error (" Error in " __FUNCTION__);
262+ lse::getSelfModInstance ().getLogger ().error (" Error in " __FUNCTION__);
263263 }
264264 return Local<Value>();
265265 }
@@ -291,7 +291,7 @@ struct EnumDefineBuilder {
291291 try {
292292 return Number::newNumber (static_cast <int >(_val));
293293 } catch (const std::exception&) {
294- lse::getSelfPluginInstance ().getLogger ().error (" Error in get {}.{}" , enumName, _name);
294+ lse::getSelfModInstance ().getLogger ().error (" Error in get {}.{}" , enumName, _name);
295295 }
296296 return Local<Value>();
297297 });
0 commit comments