Closed x42 closed 11 months ago
Well, unicode colors where there for human readability of the AAF tree in the first place (distinguishing unsupported AAF class/objects, warnings and errors). Otherwise, this tree is pretty hard to read in plain text, especially with large AAF files. Maybe I should go with some html logging then ? Not very common, but more portable and still readable. What do you think ?
typically you would:
isatty()
)i haven't checked the actual use in libaaf (e.g. whether this is a problem of the helper-tools only or of the library itself).
you might just want to use an environment variable (LIBAAF_LOG_NO_COLOR=1
), and/or some configuration setting (aafi_set_debug()
appears to be the place to set this)
i think a more practical way would be to use an external colorizer, like grc. the basic idea is to add the color-information based on mangling the logfile with regular expressions. this way you can have logfiles that are free of ANSI control characters (and therefore can be pasted into bug-reports without giving anyone eyesore), and still have colored logfiles to inspect. also, if you your logfiles can be easily parsed with regexes, this is probably a good thing anyhow.
on the downsize, it seems that most colorizers are not really active. e.g. a quick search gives me the following packages (in no particular order)
grc
- no upstream homepage (actually there is, if you search long enough), last upload to Debian in 2021colortail
- upstream homepage dead, no VCS, last upload to Debian in 2010ccze
- upstream homepage dead, last upload to Debian in 2022; removed from Debian/testingclog
- upstream homepage dead, last upload to Debian in 2016; removed from Debian/testingOk, made ANSI colors optional by passing one extra argument (ansicolor) to aafi_set_debug()
I've also added a line prefix when printing the AAF object tree : err, wrn and uns (for unsupported object/class)
Maybe I should go with some html logging then ?
going from bad to worse :)
Log-level and log-domain is established for libraries. Provide semantics not format! Let the user application format it.
eg. provide "this is important" , then user app can thane make it bold, or red, or large.
*aaf.log
files are essentially binary files, hard to read for humans, and do not follow any common log standard.