Changeset 376 for trunk/src/core/logger.cc
- Timestamp:
- 05/28/15 10:21:10 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/logger.cc
r368 r376 8 8 #include "nv/core/time.hh" 9 9 #include <cstdio> 10 #if NV_ PLATFORM == NV_WINDOWS10 #if NV_COMPILER == NV_MSVC 11 11 #define WIN32_LEAN_AND_MEAN 12 12 #include <Windows.h> … … 51 51 #define NV_LOG_LEVEL_NAME_PAD(level) (log_level_names_pad[ (level) / 10 ]) 52 52 53 #if NV_ PLATFORM == NV_WINDOWS53 #if NV_COMPILER == NV_MSVC 54 54 static unsigned short log_color[] = 55 55 { … … 145 145 size_t ssize = timestamp( stamp ); 146 146 147 #if NV_ PLATFORM == NV_WINDOWS147 #if NV_COMPILER == NV_MSVC 148 148 if ( m_color ) SetConsoleTextAttribute( m_handle, FOREGROUND_INTENSITY ); 149 149 WriteConsole( m_handle, stamp, ssize, nullptr, nullptr ); … … 170 170 else 171 171 fwrite( "] ", 2, 1, stdout ); 172 fwrite( stamp.data(), stamp.size(), 1, stdout );172 fwrite( message.data(), message.size(), 1, stdout ); 173 173 fwrite( "\n", 1, 1, stdout ); 174 174 #endif … … 233 233 : m_color( coloring ) 234 234 { 235 #if NV_ PLATFORM == NV_WINDOWS235 #if NV_COMPILER == NV_MSVC 236 236 m_handle = GetStdHandle( STD_OUTPUT_HANDLE ); 237 237 #else … … 240 240 } 241 241 242 size_t nv::log_sink::timestamp( char* buffer ) const242 nv::size_t nv::log_sink::timestamp( char* buffer ) const 243 243 { 244 244 uint32 ms = get_system_ms(); … … 248 248 unsigned int m = (unsigned int)(secs / 60) % 60; 249 249 unsigned int s = secs % 60; 250 #if NV_ PLATFORM == NV_WINDOWS250 #if NV_COMPILER == NV_MSVC 251 251 sprintf_s( buffer, 16, "%02d:%02d:%02d.%02d", h, m, s, mm ); 252 252 #else
Note: See TracChangeset
for help on using the changeset viewer.