Skip to content

Commit 3b74cb5

Browse files
committed
refactor: remove more macro
1 parent 06c1757 commit 3b74cb5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/legacy/api/RemoteCallAPI.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <string>
2222

2323
#define DEFAULT_REMOTE_CALL_NAME_SPACE "LLSEGlobal"
24-
#define logger lse::getSelfPluginInstance().getLogger()
2524

2625
//////////////////// Remote Call ////////////////////
2726

@@ -180,8 +179,12 @@ Local<Value> extract(RemoteCall::ValueType&& val) {
180179
Local<Value> MakeRemoteCall(const string& nameSpace, const string& funcName, const Arguments& args) {
181180
auto& func = RemoteCall::importFunc(nameSpace, funcName);
182181
if (!func) {
183-
logger.error("Fail to import! Function [{}::{}] has not been exported!", nameSpace, funcName);
184-
logger.error("In plugin <{}>", getEngineOwnData()->pluginName);
182+
lse::getSelfPluginInstance().getLogger().error(
183+
"Fail to import! Function [{}::{}] has not been exported!",
184+
nameSpace,
185+
funcName
186+
);
187+
lse::getSelfPluginInstance().getLogger().error("In plugin <{}>", getEngineOwnData()->pluginName);
185188
return Local<Value>();
186189
}
187190

@@ -211,7 +214,7 @@ bool LLSEExportFunc(
211214
try {
212215
auto iter = getEngineData(engine)->exportFuncs.find(identifier);
213216
if (iter == getEngineData(engine)->exportFuncs.end()) {
214-
logger.debug("");
217+
lse::getSelfPluginInstance().getLogger().debug("");
215218
return "";
216219
}
217220
auto scriptCallback = iter->second.callback.get();

src/legacy/main/BuiltinCommands.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
extern bool isInConsoleDebugMode;
1717
extern ScriptEngine* debugEngine;
1818

19-
#define OUTPUT_DEBUG_SIGN() std::cout << "> " << std::flush
20-
2119
bool ProcessDebugEngine(const std::string& cmd) {
2220
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON
2321
// process python debug seperately
@@ -33,11 +31,11 @@ bool ProcessDebugEngine(const std::string& cmd) {
3331
std::ostringstream sout;
3432
PrintValue(sout, result);
3533
lse::getSelfPluginInstance().getLogger().info(sout.str());
36-
OUTPUT_DEBUG_SIGN();
34+
std::cout << "> " << std::flush;
3735
}
3836
} catch (Exception& e) {
3937
PrintException(e);
40-
OUTPUT_DEBUG_SIGN();
38+
std::cout << "> " << std::flush;
4139
}
4240
return false;
4341
}
@@ -72,7 +70,7 @@ void RegisterDebugCommand() {
7270
// StartDebug
7371
lse::getSelfPluginInstance().getLogger().info("Debug mode begins");
7472
isInConsoleDebugMode = true;
75-
OUTPUT_DEBUG_SIGN();
73+
std::cout << "> " << std::flush;
7674
}
7775
}
7876
});

0 commit comments

Comments
 (0)