fix log not logging anything

This commit is contained in:
altalk23 2022-10-08 13:59:51 +03:00
parent 4614d2c21a
commit df4b4dbd9c
4 changed files with 6 additions and 5 deletions

View file

@ -40,7 +40,7 @@ __attribute__((constructor)) void _entry() {
if (ghc::filesystem::exists(updatesDir / "Geode.dylib", error) && !error) {
ghc::filesystem::rename(
updatesDir / "Geode.dylib",
workingDir / "Geode.dylib", error
libDir / "Geode.dylib", error
);
if (error) {
displayError(std::string("Couldn't update Geode: ") + error.message());

View file

@ -57,7 +57,8 @@ void InternalLoader::executeGDThreadQueue() {
void InternalLoader::logConsoleMessage(std::string const& msg) {
if (m_platformConsoleOpen) {
std::cout << msg;
// TODO: make flushing optional
std::cout << msg << '\n' << std::flush;
}
}

View file

@ -371,12 +371,12 @@ Loader::~Loader() {
}
void Loader::pushLog(log::Log&& log) {
m_logs.push_back(std::move(log));
std::string logStr = log.toString(true);
InternalLoader::get()->logConsoleMessage(logStr);
m_logStream << logStr << std::endl;
m_logs.push_back(std::move(log));
}
void Loader::popLog(log::Log* log) {

View file

@ -83,7 +83,7 @@ std::string Log::toString(bool logTime) const {
res += fmt::format("{:%H:%M:%S}", this->m_time);
}
res += fmt::format("[{}]:", this->m_sender ? this->m_sender->getName() : "?");
res += fmt::format(" [{}]: ", this->m_sender ? this->m_sender->getName() : "?");
for (ComponentTrait* i : this->m_components) {
res += i->_toString();