dita-ot / dita-ot

DITA Open Toolkit — the open-source publishing engine for content authored in the Darwin Information Typing Architecture.
https://www.dita-ot.org
Apache License 2.0
386 stars 193 forks source link

Fix missing log level prefix when not using colours #4409

Closed jelovirt closed 3 months ago

jelovirt commented 3 months ago

Description

Fix missing log level prefix Error: or Warning: when not using colours in CLI.

Motivation and Context

Fixes #4406

How Has This Been Tested?

Manual testing.

Type of Changes

raducoravu commented 3 months ago

In general it's crazy hard to programmatically parse console lines in order to gather errors, some error lines look like this "[ERROR]", some look like this "Error!", and now some look like "Error:". Same for all severity types from info/warning/fatal error.

jelovirt commented 3 months ago

Since the CLI default logger is intended for human consumption, it may be easier to use some other logger that will output log messages in easier to parse format.

jelovirt commented 3 months ago

I will need to write initial docs for using customized or alternative logger for different log use cases.

raducoravu commented 3 months ago

@jelovirt yes this might help, see also this discussion here:

https://github.com/orgs/dita-ot/discussions/4340

There are various places from where errors may arise: SAX Parser, XSLT stylesheets, DITA OT code, Apache FOP.