46 #if defined(VL_PLATFORM_WINDOWS) 52 CONSOLE_SCREEN_BUFFER_INFO screen_info;
53 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
54 GetConsoleScreenBufferInfo(
58 wAttributes = screen_info.wAttributes;
59 SetConsoleTextAttribute(hConsole, c);
64 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
65 SetConsoleTextAttribute(hConsole, wAttributes );
68 #define SET_TEXT_COLOR_YELLOW() ScopedColor scoped_color(FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_INTENSITY); 69 #define SET_TEXT_COLOR_RED() ScopedColor scoped_color(FOREGROUND_RED|FOREGROUND_INTENSITY); 70 #define SET_TEXT_COLOR_PURPLE() ScopedColor scoped_color(FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY); 71 #define SET_TEXT_COLOR_GREEN() ScopedColor scoped_color(FOREGROUND_GREEN|FOREGROUND_INTENSITY); 72 #define SET_TEXT_COLOR_BLUE() ScopedColor scoped_color(FOREGROUND_BLUE|FOREGROUND_INTENSITY); 76 ScopedColor(
const char* color)
113 printf(
"%s",
"\033[0m");
116 #define SET_TEXT_COLOR_YELLOW() ScopedColor scoped_color("\033[1;33m"); 117 #define SET_TEXT_COLOR_RED() ScopedColor scoped_color("\033[31m"); 118 #define SET_TEXT_COLOR_PURPLE() ScopedColor scoped_color("\033[1;31m"); 119 #define SET_TEXT_COLOR_GREEN() ScopedColor scoped_color("\033[1;32m"); 120 #define SET_TEXT_COLOR_BLUE() ScopedColor scoped_color("\033[1;34m"); 187 VL_LOG_ERROR <<
"Condition '" << expr <<
"' failed at " << file <<
":" << line <<
"\n";
191 #if defined(VL_PLATFORM_WINDOWS) && VL_MESSAGEBOX_CHECK == 1 192 String msg =
Say(
"Condition \"%s\" failed.\n\n%s:%n\n") << expr << file << line;
193 MessageBox(
NULL, (
wchar_t*)msg.
ptr(), L
"Visualization Library Debug", MB_OK | MB_ICONEXCLAMATION);
220 std::cout << stdstr << std::flush;
223 mFile << stdstr << std::flush;
static void debug(const String &message)
Use this function to provide extra information useful to investigate and solve problems.
virtual void printImplementation(ELogLevel level, const String &message)
#define SET_TEXT_COLOR_RED()
A simple String formatting class.
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
< No log information is generated.
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
#define SET_TEXT_COLOR_BLUE()
void setLogFile(const String &file)
VLCORE_EXPORT void log_failed_check(const char *, const char *, int)
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
const wchar_t * ptr() const
Returns the 0-terminated utf16 string.
#define SET_TEXT_COLOR_YELLOW()
Visualization Library main namespace.
static void bug(const String &message)
Use this function to provide information about programming errors: wrong parameter initialization...
#define SET_TEXT_COLOR_PURPLE()
static void notify(const String &message)
Important application message for the user.
An interface to implement simple platform-independent mutexes used to protect critical sections...
static void print(const String &message)
Application message for the user.
A class that locks the specified mutex when constructed and unlocks it when destructed.
bool empty() const
Returns true if length() == 0.
#define SET_TEXT_COLOR_GREEN()
< Outputs critical and runtime error messages.
static IMutex * logMutex()
The mutex used to synchronize concurrent calls to the log functions.
< Outputs extra information messages useful for debugging, plus all normal and error messages...
virtual void printImplementation(ELogLevel level, const String &message)=0
std::string toStdString() const
Returns a UTF8 encoded std::string.
VLCORE_EXPORT Log * defLogger()
Returns the currently installed default logger.
VLCORE_EXPORT GlobalSettings * globalSettings()
Returns VisulizationLibrary's global settings.