From 444d1ff1f12e5e92ce673bd171b82ebe05ec13b4 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 5 Jan 2026 13:00:22 -0800 Subject: [PATCH] colorize outer exception printing --- ioc/groupsourcehooks.cpp | 4 +--- qsrv/Makefile | 2 ++ qsrv/softMain.cpp | 3 ++- src/utilpvt.h | 5 +++++ tools/call.cpp | 8 ++++---- tools/get.cpp | 2 +- tools/info.cpp | 2 +- tools/list.cpp | 2 +- tools/monitor.cpp | 2 +- tools/mshim.cpp | 6 +++--- tools/put.cpp | 6 +++--- tools/pvxvct.cpp | 2 +- 12 files changed, 25 insertions(+), 19 deletions(-) diff --git a/ioc/groupsourcehooks.cpp b/ioc/groupsourcehooks.cpp index 8a2bd89..d7ab319 100644 --- a/ioc/groupsourcehooks.cpp +++ b/ioc/groupsourcehooks.cpp @@ -23,6 +23,7 @@ #include #include "qsrvpvt.h" +#include "utilpvt.h" #include "groupsource.h" #include "groupconfigprocessor.h" #include "iocshcommand.h" @@ -30,9 +31,6 @@ #if EPICS_VERSION_INT < VERSION_INT(7, 0, 3, 1) # define iocshSetError(ret) do { (void)ret; }while(0) #endif -#ifndef ERL_ERROR -# define ERL_ERROR "ERROR" -#endif // include last to avoid clash of #define printf with other headers #include diff --git a/qsrv/Makefile b/qsrv/Makefile index 03b3f1b..9d231cf 100644 --- a/qsrv/Makefile +++ b/qsrv/Makefile @@ -5,6 +5,8 @@ include $(TOP)/configure/CONFIG # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= +USR_CPPFLAGS += -I$(TOP)/src + PROD_IOC += softIocPVX softIocPVX_SRCS += softMain.cpp diff --git a/qsrv/softMain.cpp b/qsrv/softMain.cpp index aa8b0bb..7f3df8f 100644 --- a/qsrv/softMain.cpp +++ b/qsrv/softMain.cpp @@ -32,6 +32,7 @@ #include "iocsh.h" #include "osiFileName.h" #include "epicsInstallDir.h" +#include "utilpvt.h" #include @@ -289,7 +290,7 @@ int main(int argc, char *argv[]) return 0; }catch(std::exception& e){ - std::cerr<<"Error: "< #include +#include #include #include @@ -46,6 +47,10 @@ # endif #endif +#ifndef ERL_ERROR +# define ERL_ERROR "ERROR" +#endif + #include namespace pvxs {namespace impl { diff --git a/tools/call.cpp b/tools/call.cpp index fa171ef..9a853e5 100644 --- a/tools/call.cpp +++ b/tools/call.cpp @@ -86,14 +86,14 @@ int main(int argc, char *argv[]) auto sep = fv.find_first_of('='); if(sep==std::string::npos) { - std::cerr<<"Error: expected = not \""<= not \""<= not \""<= not \""<