Skip to content
Snippets Groups Projects
Commit 1417a4e4 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

allow none as timestamp for a logger

parent 0e32a3f8
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ enum key_enum_e
//Time
TAI , // = 50
ISO ,
NONE ,
ENDOFKEY
} ;
#define PIPELINE_NAME "pipeline-name"
......
......@@ -72,7 +72,7 @@ struct sv_execlog_s
unsigned int destination ;
uint32_t backup ;
uint32_t maxsize ;
/**timestamp=49->tai,timestamp=50->iso*/
/**timestamp=50->tai,timestamp=51->iso,52->none*/
int timestamp ;
unsigned int idga ; //pos in genalloc gadeps
unsigned int nga ; //len of idga in genalloc gadeps
......
......@@ -77,6 +77,7 @@ char const *get_keybyid(key_enum_t key)
//Time
(key == TAI ) ? "tai" :
(key == ISO ) ? "iso" :
(key == NONE ) ? "none" :
//logger
(key == PRODUCER ) ? "producer-for" :
(key == CONSUMER ) ? "consumer-for" :
......@@ -104,5 +105,6 @@ int const key_enum_options_el = DOWN - LOGGER ;
int const key_enum_flags_el = AUTO - DOWN ;
int const key_enum_build_el = NEED - AUTO ;
int const key_enum_mandatory_el = TAI - NEED ;
int const key_enum_time_el = ENDOFKEY - TAI ;
int const key_enum_time_el = PRODUCER - TAI ;
int const key_enum_logger_el = ENDOFKEY - PRODUCER ;
......@@ -319,7 +319,7 @@ int write_logger(sv_alltype *sv, sv_execlog *log,char const *name, char const *d
char *time = NULL ;
char *pmax = NULL ;
char *pback = NULL ;
char *timestamp = NULL ;
char *timestamp = "t" ;
char max[UINT32_FMT] ;
char back[UINT32_FMT] ;
char const *userhome ;
......@@ -447,10 +447,7 @@ int write_logger(sv_alltype *sv, sv_execlog *log,char const *name, char const *d
}
if (!stralloc_0(&destlog)) retstralloc(0,"write_logger") ;
if (log->timestamp == TAI)
timestamp = "t" ;
else
timestamp = "T" ;
if (log->timestamp == ISO) timestamp = "T" ;
if (log->backup > 0)
{
......@@ -474,8 +471,11 @@ int write_logger(sv_alltype *sv, sv_execlog *log,char const *name, char const *d
if (!stralloc_cats(&exec,S6_BINPREFIX "s6-log " "n")) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec,pback)) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec," ")) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec,timestamp)) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec," ")) retstralloc(0,"write_logger") ;
if (log->timestamp)
{
if (!stralloc_cats(&exec,timestamp)) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec," ")) retstralloc(0,"write_logger") ;
}
if (!stralloc_cats(&exec,"s")) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec,pmax)) retstralloc(0,"write_logger") ;
if (!stralloc_cats(&exec," ")) retstralloc(0,"write_logger") ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment