Closed GasimGasimzada closed 8 months ago
I figured out converting variadic args to string:
logger["debug"] = [](sol::variadic_args args) {
auto debug = Engine::getUserLogger().debug();
for (auto arg: args) {
debug << state["tostring"](arg.get<sol::object>()).get<String>() << "\t";
}
};
And I set the print
function by just assigning it to state
:
state.set_function("print", [](sol::variadic_args args) { ... });
I want to do two things in Sol3:
I have a custom logger that I provide:
I want to make this function accept any argument and automatically convert those arguments to string:
I also want to somehow make the global print to do the same:
Is this a valid way to override the
print
function?