1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-03 03:23:33 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Misa
ac11b91540 Remove return values from vlog_* functions
They weren't ever being used, and nobody really ever uses the return
value from the printf family of functions anyway. They return how many
bytes were actually printed, but if it's less than you expected then
there's not much you can really do about them. Also the vlog_* functions
were computing them inaccurately because I only set the return value to
the return value of vprintf when there's other print functions being
called, but regardless there's no reason to have a return value here
anyway.
2022-08-29 10:48:21 -07:00
Misa
3bb3976e7e vlog_init: Fix brace style
Whoops.
2022-08-29 10:46:05 -07:00
Misa
aca1e8695c Remove attempt to autoenable color output on Win32
This started when I saw the warning that GetVersionExW was deprecated,
then looked it up and found StackOverflow answers saying that you should
basically detect the feature directly instead of checking the version,
which makes sense to me. Then I found that I could probably detect color
support by using GetConsoleMode and GetStdHandle. But then I asked
myself what the point was unless you could get color output directly in
the terminal, which it seems like you really can't if your app is a GUI
app. (I have no idea why Windows makes this pointless distinction
between console and GUI apps...)

I tested Command Prompt, PowerShell, Windows Terminal (which is just
PowerShell again), and even Git Bash (MINGW64), but none of them will
ever give the console output of a GUI app such as VVVVVV. The closest I
got is that Git Bash doesn't seem to detach the process, but it will
simply produce no output.

At this point I feel like it's not worth it keeping this code around if
it didn't even work in the first place, so I'm removing it. People can
always enable color by using the -forcecolor command-line argument
anyway.
2022-08-29 09:37:30 -07:00
Misa
3decf54dbc Mark all vlog functions with printf attributes
This ensures that compiler warnings about format strings will apply to
all calls of these functions as well.
2021-09-27 20:49:09 -07:00
Misa
b652d327dc Add debug logs
These are disabled by default, because they're noisy. To enable them,
pass -debug.
2021-09-01 14:34:55 -07:00
Misa
2eb9e23ecc Allow disabling output/fine-tuning output
-nooutput disables output completely (both STDOUT and STDERR). -noinfo
disables INFO lines.  -nowarn disables WARN lines. -noerror disables
ERROR lines.
2021-09-01 14:34:55 -07:00
Misa
c68a274c4f Add command-line options to force-enable/disable color
`-forcecolor` will force color to be on. `-nocolor` will force color to
be off.

And just because I'm a nice person, I've also added British versions of
those flags. As a treat.
2021-09-01 14:34:55 -07:00
Misa
ac85f57441 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.
2021-09-01 14:34:55 -07:00
Misa
d9737589de Add logging functions
Named "vlogs" because they're logs for VVVVVV. Also it's a funny name.
2021-09-01 14:34:55 -07:00