Skip to content

Commit 07f521d

Browse files
committed
fixing macOS issue
1 parent d2a8ac4 commit 07f521d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

runtime/Includes/PreCompiled.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
#include <mlx_profile.h>
77
#include <mlx.h>
8+
89
#include <cstdio>
910
#include <cstdarg>
1011
#include <iostream>
1112
#include <cstddef>
1213
#include <cstdint>
1314
#include <cstdlib>
1415
#include <cstring>
16+
#include <ctime>
1517

1618
#include <vulkan/vulkan.h>
1719

runtime/Sources/Core/Logs.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ namespace mlx
4747
default: break;
4848
}
4949

50+
/*
5051
const std::chrono::zoned_time current_time{ std::chrono::current_zone(), std::chrono::floor<std::chrono::milliseconds>(std::chrono::system_clock::now()) };
51-
5252
std::cout << Ansi::yellow << std::format("[{0:%H:%M:%S}] ", current_time) << Ansi::def << code_infos << message << std::endl;
53+
*/
54+
std::time_t now = time(0);
55+
std::tm tstruct = *localtime(&now);
56+
char buffer[80];
57+
std::strftime(buffer, sizeof(buffer), "[%X] ", &tstruct);
58+
std::cout << Ansi::yellow << buffer << Ansi::def << code_infos << message << std::endl;
5359

5460
if(type == LogType::FatalError)
5561
{

0 commit comments

Comments
 (0)