///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 120 | |
| 121 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 122 | std::string GetCurrentTimestamp() |
| 123 | { |
| 124 | |
| 125 | std::time_t now = std::time(nullptr); |
| 126 | std::tm timeInfo{}; |
| 127 | |
| 128 | // Convert to local time safely |
| 129 | if (localtime_s(&timeInfo, &now) != 0) |
| 130 | return "[Invalid Time] "; |
| 131 | |
| 132 | char buf[32]; // Format: [YYYY-MM-DD HH:MM:SS] |
| 133 | if (std::strftime(buf, sizeof(buf), "[%Y-%m-%d %H:%M:%S] ", &timeInfo) == 0) |
| 134 | return "[Time Format Error] "; |
| 135 | |
| 136 | return std::string(buf); |
| 137 | } |
| 138 | |
| 139 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 140 | std::string FSecure::C3::Utils::ConvertLogMessageToConsoleText(std::string_view relayName, LogMessage const& message, std::string_view sender) |
no outgoing calls
no test coverage detected