File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ Local<Value> LoggerClass::setTitle(const Arguments& args) {
127127 CHECK_ARG_TYPE (args[0 ], ValueKind::kString )
128128
129129 getEngineOwnData ()->logger = ll::io::LoggerRegistry::getInstance ().getOrCreate (args[0 ].asString ().toString ());
130- return Boolean::newBoolean (false );
130+ return Boolean::newBoolean (true );
131131}
132132
133133// /////////////// Helper /////////////////
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Local<Value> Log(const Arguments& args) {
2424 std::ostringstream sout;
2525 for (int i = 0 ; i < args.size (); ++i) PrintValue (sout, args[i]);
2626 sout << std::endl;
27- getEngineOwnData ()->plugin -> getLogger (). info (sout.str ());
27+ getEngineOwnData ()->logger -> info (sout.str ());
2828 return Boolean::newBoolean (true );
2929 }
3030 CATCH (" Fail in Log!" );
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ struct SimpleCallbackData
3838// It is similar to ll::mod::Mod, it stores data of an engine(usually a plugin).
3939struct EngineOwnData {
4040 // 基础信息
41- std::string pluginName = " " ;
42- std::string pluginFileOrDirPath = " " ;
41+ std::string pluginName = {} ;
42+ std::string pluginFileOrDirPath = {} ;
4343 std::string engineType = LLSE_BACKEND_TYPE;
4444
4545 // 表单回调
@@ -75,7 +75,7 @@ struct EngineOwnData {
7575 std::string defaultLocaleName;
7676
7777 std::shared_ptr<lse::Plugin> plugin;
78- std::shared_ptr<ll::io::Logger> logger = ll::io::LoggerRegistry::getInstance().getOrCreate(pluginName) ;
78+ std::shared_ptr<ll::io::Logger> logger;
7979
8080 // 玩家绑定数据
8181 std::unordered_map<std::string, script::Global<Value>> playerDataDB;
Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ ll::Expected<> PluginManager::load(ll::mod::Manifest manifest) {
135135 try {
136136 script::EngineScope engineScope (scriptEngine);
137137
138- // Set plugins's logger title
139- getEngineOwnData ()->pluginName = manifest.name ;
138+ // Init plugin logger
139+ getEngineOwnData ()->logger = ll::io::LoggerRegistry::getInstance (). getOrCreate ( manifest.name ) ;
140140
141141#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON
142142 scriptEngine.eval (" import sys as _llse_py_sys_module" );
You can’t perform that action at this time.
0 commit comments