[nos-bbs] Single log or a daily log in the logs directory - Recap + Macro so that you can choose
Boudewijn (Bob) Tenty
bobtenty at gmail.com
Wed Oct 1 23:58:21 EDT 2014
This is a recap of the changes needed to main.c for a single log in the
logs directory but I changed it to
a macro so that you can choose between a single jnos log or a daily log
(old behaviour) in the "logs" directory
by setting define/undef SINGLE_JNOS_LOG in config.h
Changes
1)
This needs the following additional line to config.h:
#define SINGLE_JNOS_LOG /* (New) Single log in directory "logs", leave
undefined for old behaviour (Daily log) */
The following two changes are needed to the original main.c
2)
Look for the line....
sprintf (ML, "%s/%2.2s%3.3s%2.2s", LogsDir, cp + 8, cp + 4, cp + 22);
- This is around line 1101 in function nos_log() -
Change that line to:
#ifdef SINGLE_JNOS_LOG /* 1Oct2014, Boudewijn (Bob) VE3TOK, Added macro
for single or daily log */
sprintf(ML, "%s/%s", LogsDir, "nos.log");
#else
sprintf (ML, "%s/%2.2s%3.3s%2.2s", LogsDir, cp + 8, cp + 4, cp
+ 22); /* Old behaviour, daily jnos log */
#endif
3)
The resulting single log contains a time stamp what is a little bit
nasty because you don't have a point of reference
anymore in the log name. A date will be added to the time stamp if a
single log is chosen.
(Same date/time stamp format as in spool/mail.log)
Look for the following line in main.c...
.
fprintf (fp, "%9.9s", cp + 11);
This is around line 1112 in function nos_log(), just above "return fp"
in the same nos_log() function.
Change it to:
#ifdef SINGLE_JNOS_LOG /* 1Oct2014, Boudewijn
(Bob) VE3TOK change time stamp to a date + time stamp when we use a
single log */
fprintf (fp, "%.24s ", cp);
#else
fprintf (fp, "%9.9s", cp + 11); /* Old behaviour,
time stamp only in a daily log */
#endif
Recompile.
73,
Bob VE3TOK
More information about the nos-bbs
mailing list