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
committed by GitHub
parent 5e4dd502d9
commit 41c0ddd72d
38 changed files with 193 additions and 152 deletions
+4 -3
View File
@@ -21,6 +21,7 @@
// THE SOFTWARE.
#include "lib/common/demangle.hpp"
#include "lib/common/logging.hpp"
#include <glog/logging.h>
@@ -79,14 +80,14 @@ cxa_demangle(std::string_view _mangled_name, int* _status)
}
case -1:
{
PLOG(ERROR) << "memory allocation failure occurred demangling " << _demangled_name;
ROCP_ERROR << "memory allocation failure occurred demangling " << _demangled_name;
break;
}
case -2: break;
case -3:
{
PLOG(ERROR) << "Invalid argument in: (\"" << _demangled_name << "\", nullptr, nullptr, "
<< _status << ")";
ROCP_ERROR << "Invalid argument in: (\"" << _demangled_name << "\", nullptr, nullptr, "
<< _status << ")";
break;
}
default: break;