Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and use the new MLOG_* message and logging utilities #155

Open
yanyh15 opened this issue Jan 27, 2023 · 1 comment
Open

Cleanup and use the new MLOG_* message and logging utilities #155

yanyh15 opened this issue Jan 27, 2023 · 1 comment
Assignees

Comments

@yanyh15
Copy link
Member

yanyh15 commented Jan 27, 2023

message and logging (MLOG) has been reimplemented to have much simpler APIs than the original printf/mprintf/mlog that are Sawyer-based. The implementation is in src/util/mlog.h/C files and a test file is provided in tests/smoke/unit/Utilitiy/testMLog.C. The mlog.h header files include docs about how to use those APIs and the testMLog.C shows examples of using them (for both C-based and C++-based APIs). The implementation also include different variants of ASSERT and ABORT.

MLOG can be written in text/source code in either MLOG, MLog, mlog, but not Mlog, i.e. the first two letters (m and l) should be written either both capitalized, or both in small case, not mix.

Since the APIs are all in C/C++ macros, so we all use capitalized identifiers, e.g. MLOG_WARN_*

MLOG_* APIs allows for verbose level control so messages can be spit out based on the level, but it does not need to do the level control when using those APIs. Verbose-controlled mlog are all implemented by those APIs. Please check mlog.h file in details about the levels and details.

Right now, we have not yet completed updated and cleanup the current printf/verbose control in the source base. To do that requires a substantial amount of work and depth understanding of the whole source code, we will do that when we are comfortable and have time for that.

Currently the verbose-level control is done by a single global variable to control all the mlogging, ideally, we can implement to support subject-level verbose control or even file/functional level verbose-control, of course they will all fall back to global level verbose control if no local-level is provided.

@yanyh15 yanyh15 self-assigned this Jan 27, 2023
@yanyh15
Copy link
Member Author

yanyh15 commented Feb 1, 2023

stacktrace support are now added in mlog.C, check 1b62d06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant