diff --git a/src/EHS.cpp b/src/EHS.cpp index e2a49a7..a12d78b 100644 --- a/src/EHS.cpp +++ b/src/EHS.cpp @@ -1,6 +1,7 @@ #include "ehs/EHS.h" #include "ehs/Log.h" #include "ehs/Version.h" +#include "ehs/io/Console.h" #include "ehs/GarbageCollector.h" #include "ehs/io/audio/Audio.h" #include "ehs/io/img/Img.h" @@ -620,8 +621,30 @@ namespace ehs } } +void LogRaised(const ehs::Log& log) +{ + ehs::Array tags = log.GetTags(); + + ehs::Str_8 result = "{"; + + for (ehs::UInt_32 i = 0; i < tags.Size(); ++i) + { + result += tags[i]; + if (i != tags.Size() - 1) + result += ", "; + } + + result += "} (" + ehs::Str_8::FromNum(log.GetCode()) + "): " + log.GetMsg(); + + ehs::Console::Write_8(result); +} + int main() { + ehs::Console::Attach(); + + ehs::Log::SetCallback(LogRaised); + ehs::Audio::AddCodec({ "Waveform Audio", "wav",