diff --git a/Src/IACore/imp/cpp/IACore.cpp b/Src/IACore/imp/cpp/IACore.cpp index 6924066..eae26f8 100644 --- a/Src/IACore/imp/cpp/IACore.cpp +++ b/Src/IACore/imp/cpp/IACore.cpp @@ -52,6 +52,11 @@ namespace IACore return std::chrono::duration_cast(HighResClock::now() - g_startTime).count(); } + FLOAT32 GetRandom() + { + return static_cast(rand()) / static_cast(RAND_MAX); + } + UINT32 GetRandom(IN UINT32 seed) { srand(seed); diff --git a/Src/IACore/imp/cpp/IPC.cpp b/Src/IACore/imp/cpp/IPC.cpp index 2d68a90..969e89f 100644 --- a/Src/IACore/imp/cpp/IPC.cpp +++ b/Src/IACore/imp/cpp/IPC.cpp @@ -360,10 +360,19 @@ namespace IACore [sid](IN StringView line) { UNUSED(sid); UNUSED(line); +#if __IA_DEBUG + puts(std::format(__CC_MAGENTA "[Node:{}:STDOUT|STDERR]: {}" __CC_DEFAULT, sid, line).c_str()); +#endif }, [sid](IN Expected result) { UNUSED(sid); UNUSED(result); +#if __IA_DEBUG + if (!result) + puts(std::format(__CC_RED "Failed to spawn Node: {} with error '{}'" __CC_DEFAULT, sid, result.error()).c_str()); + else + puts(std::format(__CC_RED "[Node: {}]: Exited with code {}" __CC_DEFAULT, sid, *result).c_str()); +#endif }); // Give some time for child node to stablize diff --git a/Src/IACore/inc/IACore/IACore.hpp b/Src/IACore/inc/IACore/IACore.hpp index 0666b32..5c70a58 100644 --- a/Src/IACore/inc/IACore/IACore.hpp +++ b/Src/IACore/inc/IACore/IACore.hpp @@ -31,6 +31,7 @@ namespace IACore UINT64 GetTicksCount(); FLOAT64 GetSecondsCount(); + FLOAT32 GetRandom(); UINT32 GetRandom(IN UINT32 seed); INT64 GetRandom(IN INT64 min, IN INT64 max);