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

@@ -361,6 +361,8 @@ int main(int argc, char *argv[])
char* baseDir = NULL;
char* assetsPath = NULL;
vlog_init();
for (int i = 1; i < argc; ++i)
{
#define ARG(name) (SDL_strcmp(argv[i], name) == 0)