NatLabRockies / NatLabRockies/OpenStudio

[refactor] Assess the Logger situation and eliminate inefficiency

Open
#5,038 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component - logs and warnings Enhancement Request Triage
Dominant language
C++
Stars
646
Forks
237
Avg merge
3d 11h
Merged PRs (30d)
10

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/utilities/core/LogMessage.hpp and tracing the StringStreamLogSink uses described for the EnergyPlus ForwardTranslator, then compare the XMLValidator pattern and the Boost sink references. Done means agreeing on and implementing a logging path that avoids regex parsing, while addressing the stated sink, concurrency, mutex, and naming concerns.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.