Convert LOG() -> ROCP_X logging macros. (#695)

* Convert LOG() -> ROCP_X logging macros.

This patch converts the LOG() macro to the ROCP_X logging macros.
There are the following levels of logs.

Logs whos expressions are not evaluated unless the log level is enabled:

ROCP_TRACE - VLOG(2) (enabeled by env variable GLOG_v=2)
ROCP_INFO - VLOG(1) (enabeled by env variable GLOG_v=1)

Logs whos expressions are always evaluated:

ROCP_WARNING - LOG(WARNING)
ROCP_ERROR - LOG(ERROR)
ROCP_FATAL - LOG(FATAL)
ROCP_DFATAL - DLOG(FATAL) (only fatal in debug mode)

* source formatting (clang-format v11) (#696)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* Minor fix

* Fixes for VLOG before main

* fix vmodule

* source formatting (clang-format v11) (#718)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* memory leak fix

* Vlog change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>
This commit is contained in:
Benjamin Welton
2024-04-02 17:15:30 -07:00
zatwierdzone przez GitHub
rodzic 5e4dd502d9
commit 41c0ddd72d
38 zmienionych plików z 193 dodań i 152 usunięć
@@ -140,7 +140,7 @@ get_ast_map()
yyparse(&ast);
if(!ast)
{
LOG(ERROR) << fmt::format("Unable to parse metric {}", metric);
ROCP_ERROR << fmt::format("Unable to parse metric {}", metric);
throw std::runtime_error(fmt::format("Unable to parse metric {}", metric));
}
try
@@ -155,7 +155,7 @@ get_ast_map()
// logic as a Finish() method
} catch(std::exception& e)
{
LOG(ERROR) << e.what();
ROCP_ERROR << e.what();
throw std::runtime_error(
fmt::format("AST was not generated for {}:{}", gfx, metric.name()));
}