Add colors to logging

This includes the bold as well.

INFO is just default, WARN is yellow, ERROR is red.

We try to automatically detect if the output is a TTY (and thus supports
colors), and don't emit colors if so. Windows 10 supports ANSI color
codes starting with a specific build, but we don't care to emit whatever
garbage Microsoft invented for builds older than that.
This commit is contained in:
Misa
2021-02-23 15:22:28 -08:00
committed by Misa Elizabeth Kai
parent 96539f891c
commit ac85f57441
3 changed files with 62 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ extern "C"
{
#endif
void vlog_init(void);
int vlog_info(const char* text, ...);
int vlog_warn(const char* text, ...);