NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
501 stars 191 forks source link

[refactor] Assess the Logger situation and eliminate inefficiency #5038

Open jmarrec opened 11 months ago

jmarrec commented 11 months ago

Enhancement Request

Eliminate the use of StringStreamLogSink

 * The use of a `StringStreamSinkLogSink`, for eg for EnergyPlus ForwardTranslator and then **regex parsing** that to derive logMessages is an abomination that should be eliminated.

Detailed Description

Regex parsing is slow, and expensive.

It also poses an extensibility/customization issue: If changing the formatter (the format of the log messages), the parseLogText gets thrown out the window.

Possible Implementation

  1. The use of a pattern similar to the one I used in XMLValidator is a possibility
  2. Write our end backend sink and override consume to emplace LogMessages is probably the sanest option

Other issues

Context

List of references:

shorowit commented 11 months ago

Related issue? https://github.com/NREL/OpenStudio/issues/4821