CML Message updates for C++20

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start by locating the CML message handler and its existing tests, then read how it currently formats and colors messages. Implementing the proposed changes involves source location, formatting, wrapping, Trick and non-Trick timestamps, and possibly file logging; the file logging request is open-ended. Done means the message output follows the agreed format and the handler’s tests cover the supported behavior.

Written by the indexing model from the issue text.

Description

enhancement

After we step up to C++20, add a few improvements to our message handler:

  • Use std::source_location to get the source location information. Users only need to worry about the actual message content. Pass std::source_location::current() as final defaulted argument.
  • Update the message format to be more visually distinct between messages.
  • Add option to log to a text file too?

Proposed new message format:

[WARNING] at sim-time 123.45 : /path/to/model/source.cc:100 SomeModel::update()
    This is a warning message generated from the source code. It will be colored according
    to severity like it currently is. The [TAG] will be as well. If the user specifies their own line
    breaks, those will be respected. Otherwise, their message will be automatically wrapped to
    100 (user-configurable?) lines. In a non-Trick environment, print the actual date and time
    instead of sim time. The messages will be auto-indented to separate back-to-back messages
    more clearly.
Dominant language
C++
Stars
18
Forks
9
Avg merge
2h 56m
Merged PRs (30d)
3

Getting set up

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.

More from nasa/cml

All issues in nasa/cml

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.