print ANSI escapes to stderr
unconditionally print ANSI some escapes (to colorize errors) to the stderr stream.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "errlog.h"
|
||||
#include "ellLib.h"
|
||||
#include "cvtTable.h"
|
||||
|
||||
@@ -125,12 +126,12 @@ int main(int argc, char **argv)
|
||||
}
|
||||
inFile = fopen(argv[1],"r");
|
||||
if(!inFile) {
|
||||
fprintf(stderr,"Error opening %s\n",argv[1]);
|
||||
fprintf(stderr,ERL_ERROR " opening %s\n",argv[1]);
|
||||
exit(-1);
|
||||
}
|
||||
outFile = fopen(outFilename,"w");
|
||||
if(!outFile) {
|
||||
fprintf(stderr,"Error opening %s\n",outFilename);
|
||||
fprintf(stderr,ERL_ERROR " opening %s\n",outFilename);
|
||||
exit(-1);
|
||||
}
|
||||
while(fgets(inbuf,MAX_LINE_SIZE,inFile)) {
|
||||
|
||||
@@ -1068,7 +1068,7 @@ int dbRecordNameValidate(const char *name)
|
||||
const char *pos = name;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("Error: Record/Alias name can't be empty");
|
||||
yyerrorAbort(ERL_ERROR ": Record/Alias name can't be empty");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "iocsh.h"
|
||||
#include "errSymTbl.h"
|
||||
#include "errlog.h"
|
||||
|
||||
#include "dbStaticIocRegister.h"
|
||||
#include "dbStaticLib.h"
|
||||
@@ -254,7 +255,7 @@ static void dbCreateAliasCallFunc(const iocshArgBuf *args)
|
||||
}
|
||||
dbFinishEntry(&ent);
|
||||
if(status) {
|
||||
fprintf(stderr, "Error: %ld %s\n", status, errSymMsg(status));
|
||||
fprintf(stderr, ERL_ERROR ": %ld %s\n", status, errSymMsg(status));
|
||||
iocshSetError(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ static FILE *openOutstream(const char *filename)
|
||||
errno = 0;
|
||||
stream = fopen(filename,"w");
|
||||
if(!stream) {
|
||||
fprintf(stderr,"error opening %s %s\n",filename,strerror(errno));
|
||||
fprintf(stderr,ERL_ERROR " opening %s %s\n",filename,strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
return stream;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "osiUnistd.h"
|
||||
#include "macLib.h"
|
||||
#include "dbmf.h"
|
||||
#include "errlog.h"
|
||||
|
||||
#include "epicsExport.h"
|
||||
#include "dbAccess.h"
|
||||
@@ -337,7 +338,7 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect)
|
||||
|
||||
if (dbTemplateMaxVars < 1)
|
||||
{
|
||||
fprintf(stderr,"Error: dbTemplateMaxVars = %d, must be +ve\n",
|
||||
fprintf(stderr,ERL_ERROR ": dbTemplateMaxVars = %d, must be +ve\n",
|
||||
dbTemplateMaxVars);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ static void addMacroReplacements(MAC_HANDLE * const macPvt,
|
||||
if (status) {
|
||||
status = macInstallMacros(macPvt, pairs);
|
||||
if (!status) {
|
||||
fprintf(stderr, "Error from macInstallMacros\n");
|
||||
fprintf(stderr, ERL_ERROR " from macInstallMacros\n");
|
||||
usageExit(1);
|
||||
}
|
||||
free(pairs);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsFindSymbol.h>
|
||||
#include <errlog.h>
|
||||
#include <registryRecordType.h>
|
||||
#include <registryDeviceSupport.h>
|
||||
#include <registryDriverSupport.h>
|
||||
@@ -248,7 +249,7 @@ registerAllRecordDeviceDrivers(DBBASE *pdbbase)
|
||||
|
||||
} catch(std::exception& e) {
|
||||
dbFinishEntry(&entry);
|
||||
fprintf(stderr, "Error: %s\n", e.what());
|
||||
fprintf(stderr, ERL_ERROR ": %s\n", e.what());
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user