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

RtsLoggingUpdate #673

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion OnlTools/Jevp/level.source
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# STAR LEVEL for EVP code

starver SL23b
starver SL23c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SL23b and SL23c are equivalent libraries, so this change has no effect.

#starver SL21b


unsetenv DB_SERVER_LOCAL_CONFIG
34 changes: 9 additions & 25 deletions StRoot/RTS/include/rtsLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,10 @@ void rtsLogAddJmlFile (char *fname);






#ifndef RTS_ENABLE_LOG

#define RTS_ASSERT(expr) assert(expr)
#define LOG(SEV,STRING,ARGS...)
#define rtsLogUnix_v(str, ...)
#define rtsLogAddCmd(x)


// the following become noops...
#define rtsLogLevel(x)
#define rtsLogAddDest(x,y)
#define rtsLogLevelInt(x)
#define rtsLogOutput(x)

#else /* RTS_ENABLE_LOG */

#endif

#ifdef __GNUC__
#define INLINE_HACK extern __inline__
Expand Down Expand Up @@ -182,7 +167,7 @@ INLINE_HACK void rtsLogLevel(const char *level)
#define sbLOG(args...)
#endif


#ifdef RTS_ENABLE_LOG
#define LOG(SEV,STRING,A1,A2,A3,A4,A5) \
do { \
const char *const yada = SEV ; \
Expand All @@ -195,15 +180,17 @@ INLINE_HACK void rtsLogLevel(const char *level)
logMsg((char *)"" SEV ": " __FILE__ " [line %d]: " STRING "\n",__LINE__,(unsigned int)A1,(unsigned int)A2,(unsigned int)A3,(unsigned int)A4,(unsigned int)A5) ; \
sbLOG((char *)"" SEV ": " __FILE__ " [line %d]: " STRING "\n",__LINE__,(unsigned int)A1,(unsigned int)A2,(unsigned int)A3,(unsigned int)A4,(unsigned int)A5) ; \
} \
} while(0) \
} while(0)

#endif // RTS_ENABLE_LOG

#define rtsLogOutput(x)

#else /* unix */

#ifdef RTS_ENABLE_LOG
#define RTS_ASSERT(expr) LOG(CRIT,"assert(%s) true -- certain death follows",__STRING(expr))

#endif
extern int rtsLogUnix_v(const char *str, ...) ;

extern int rtsLogOutput(int flag) ;
Expand All @@ -212,6 +199,7 @@ INLINE_HACK void rtsLogLevel(const char *level)

extern int rtsLogAddFile(char *fname) ;

#ifdef RTS_ENABLE_LOG
#ifdef RTS_LOG_COLORED

#define LOG(SEV,STRING,ARGS...) \
Expand Down Expand Up @@ -242,16 +230,12 @@ INLINE_HACK void rtsLogLevel(const char *level)
} while(0) \



#endif /* RTS_LOG_COLORED */

#endif /* ENABLE LOG */
#endif /* __vxworks */


#endif /* RTS_ENABLE_LOG */

#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */

#endif /* _RTS_LOG_H */
22 changes: 0 additions & 22 deletions StRoot/RTS/src/LOG/rtsLogUnix.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ volatile int tonkoLogLevel = 2 ;






#ifdef RTS_ENABLE_LOG
#warning "DAQ logging is enabled"
#ifdef RTS_LOG_DEFAULT_NET
#warning "DAQ logging defaults to daqman"
#else
#warning "DAQ logging defaults to STDERR"
#endif /* RTS_LOG_DEFAULT_NET */
#else
#warning "DAQ logging is disabled"
#endif /* RTS_ENABLE_LOG */


#ifdef RTS_ENABLE_LOG

#ifdef RTS_LOG_DEFAULT_NET
static int output_flag = RTS_LOG_NET ;
#else
Expand Down Expand Up @@ -391,11 +374,6 @@ static const char *getCmd(void)
#endif
}


#endif



#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 3 additions & 2 deletions mgr/Conscript-standard
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ if ( $pkg eq "Jevp") {
. $main::PATH_SEPARATOR . "#OnlTools/Jevp/StJevpBuilders"
. $main::PATH_SEPARATOR . "#OnlTools/Jevp/StJevpViewer"
. $main::PATH_SEPARATOR . $CPPPATH;
$CPPFLAGS .= " -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_NO_DEBUG ";
$CPPFLAGS .= " -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_NO_DEBUG -DRTS_ENABLE_LOG ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jevp gets compiled when anyone checks out and compiled this star-sw repository (including official library compilations at SDCC currently, e.g. $STAR/.sl73_gcc485/LIB/libJevp.so). Does this mean the logging will be enabled within Jevp for everyone? Is that the desired effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding SL23b/SL23c I don't mind if it has no effect. it works for SL23c and it was the newest so its what I chose.

regarding the desired effect. Yes, that is the desired effect. The server is a rather special case, I wouldn't expect anyone to attempt to run it other than on the official servers. For the builders, which users do run while debugging, the default is set to write to stderror, so in order to see any output the users need to have logging enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to set a define easily at the compile step? via a cons flag or environment variable? If so, I would be happy to use such a mechanism, rather than set it globally.


}

#$CPPFLAGS .= " -DNEW_DAQ_READER -D__NO_STRANGE_MUDST__ ";
Expand Down Expand Up @@ -1432,7 +1433,7 @@ if ( $#src > -1 ) {
}
}
if ($pkg eq "RTS") {
my $cppflags = "-DRTS_PROJECT_STAR -DTPXREADER -DRTS_LITTLE_ENDIAN";
my $cppflags = "-DRTS_PROJECT_STAR -DTPXREADER -DRTS_LITTLE_ENDIAN ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making a note that the only difference in this line appears to be whitespace at the end of $cppflags.

my $cpppath = $main::PATH_SEPARATOR . "#StRoot/RTS/include"
. $main::PATH_SEPARATOR . "#StRoot/RTS/trg/include"
. $main::PATH_SEPARATOR . "#StRoot/RTS/include/TPC"
Expand Down
Loading