AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code
gitlogger.h
Go to the documentation of this file.
1/*
2 * Name: filter.m4
3 *
4 * Description:
5 * DOXYGEN Input file filter for DRAMA source files.
6 *
7 * This file must be complatible with both Solaris and GNU m4. All
8 * unused macros are deleted and this comment must end up as a C/C++
9 * compatible comment which is not picked up by DOXYGEN.
10 *
11 * Synopsis:
12 * DCF(func) => Produces a link to a DRAMA C source file func.html
13 * in ../routines.
14 * DDL(link,text) => Produce a link to ../link.html, specified link text.
15 *
16 * Language: m4 macro.
17 *
18 * Author: Tony Farrell, AAO.
19 *
20 * "@(#) $Id$"
21 *
22 * History:
23 * 10-Nov-2004 - TJF - Original Version.
24 */
25
26
27
28#ifndef GITLOGGER_INC
29#define GITLOGGER_INC
30/*+
31 * G I T L O G G E R . H
32 *
33 * Function:
34 * Header file for a class which implements Logging.
35 *
36 * This file now uses DOXYGEN comments to generate the C++ web pages.
37 * m4 macros of the form @htmlonly <a href="../routines/function.html">function()</a>@endhtmlonly are used in the comments
38 * to refer to DRAMA C function documention (see DramaHtml/Makefile,
39 * DramaHtml/doxygen.config and DramaHtml/filter.m4 for detials)
40 *
41 * Description:
42 *
43 *
44 * Author(s): Tony Farrell, AAO (TJF)
45 *
46 *-
47 * History:
48 * 30-May-2001 - TJF - Original version
49 * 13-Jun-2001 - TJF - Support log directory specification to constructor.
50 * 01-Aug-2003 - TJF - Revamp to support all the DRAMA COMMS logs.
51 * 14-Aug-2003 - TJF - Support a posix background thread. Add status
52 * arguments to sync and semaphore ops. Add
53 * ARGS logging level.
54 * 09-Jan-2003 - TJF - Add support for DOXYGEN comments.
55 * 16-Sep-2004 - TJF - In the VxWorks implementation of GitLogger___Time(),
56 * the various variables are now static - to ensure all
57 * tasks int he one machine use the same values.
58 * 01-Dec-2004 - TJF - Add support for flushing the log file after every
59 * write, variable flushAlways. Add routines
60 * GitLoggerFlushAlways() and GitLoggerFile().
61 * 01-Mar-2006 - TJF - Add Log() function which takes a time tag, rather
62 * then using the current time. This required
63 * changes in LogMessage() and UpdateTime().
64 * GetLogger is now a public member static function.
65 * 29-Aug-2007 - TJF - Add GitLoggerTune function - allowing us to
66 * turn flushing, file syncs and background thread.
67 * Under linux, the fsync mode is turned off by default
68 * due to performance problems. GitLoggerTune() can
69 * turn it back on.
70 * Posix Thread support now turned back on, but the
71 * thread must be enabled using GitLoggerTune(). This
72 * change resulted in some refactoring to allow the
73 * semaphore to be created all the time, regardless
74 * of if the posix thread is running.
75 * Support a file size limit of 1/2Gb - with the file
76 * re-opened with a different name under these
77 * conditions. 1/2Gb is well within the normal limit
78 * of 2Gb - so we don't worry about catching every
79 * case where it might occur - just the main logging
80 * entry and file open.
81 * 29-Aug-2008 - TJF - Add class variables "failed", "compress" and
82 * "fileSize".
83 * Add new methods OpenIt(), CheckCompressMode(),
84 * CloseLogFile(), NewName() and NameUsed().
85 * Add new argument to GitLogger::GitLogger().
86 * 27-Nov-2009 - TJF - Rename LOG_* macros to GIT_LOG_*, but provide the
87 * original names if the GIT_LOG_NO_OLD_NAMES is
88 * NOT defined. The LOG_* versions easily conflict with
89 * external code and it is recommended that all new
90 * code define GIT_LOG_NO_OLD_NAMES before incuding this
91 * file.
92 * 08-Mar-2012 - TJF - GitLogger___Time private vars now prefixed by _ or _s (static)
93 * to help work out which is which in the code.
94 * Add updateInternalTime parameter to UpdateTime() method.
95 * 02-Jan-2012 - TJF - Finally found solution to __attribute__ problem in
96 * Log() method declaration. Apparent issue in GCC, which
97 * requires that 1 be added to each value in the list
98 * (to account for hidden "this" argument).
99 *
100 *
101 * @(#) $Id$
102 */
103/*
104 * This file now uses DOXYGEN comments - the following is placed into the
105 * index page. note that the @file block says to include the typedefs,
106 * functions etc from this file into the documentation.
107 */
108
113#ifndef VxWorks
114/*
115 * MacOsX (__APPLE__), Linux and Solaris all have posix threads We define
116 * the GIT_USE_POSIX_THREADS macro for all of these unless GIT_NO_POSIX_THREADS
117 * is defined (allowing an override for older versions if needed). For
118 * other machines, can also define GIT_USE_POSIX_THREADS at compile time, but
119 * this must be consistent for all cases where gitlogger.h is used.
120 *
121 * CURRENTLY I HAVE DISABLED POSIX THREADS IN THE CONSTRUCTOR DUE TO APPARENT
122 * CONFLICT WITH CFITSIO LIBRARY which id don't understand. TJF 2004. THE
123 * TUNING function can re-enabled it.
124 */
125#if defined(__APPLE__) || defined(__linux__) || defined(solaris2)
126#ifndef GIT_NO_POSIX_THREADS
127#define GIT_USE_POSIX_THREADS
128#endif
129#endif
130#endif
131
132
133#include "DitsTypes.h"
134#include "Ers.h"
135#ifdef VxWorks
136#include <semLib.h>
137#include <taskLib.h>
138#include <errno.h>
139#elif defined (GIT_USE_POSIX_THREADS)
140#include <signal.h>
141#include <semaphore.h>
142#include <pthread.h>
143#endif
144
145
146
147/*
148 * Usable log levels.
149 *
150 * When a log call is made, if the and of the supplied log level
151 * and the currently enabled log level is non-zero, then the message
152 * is logged.
153 */
154#define GIT_LOG_ALL 0xFFFFFFFF
155#define GIT_LOG_STARTUP 0x01
156#define GIT_LOG_ERRORS 0x02
157#define GIT_LOG_ACTENT 0x04
158#define GIT_LOG_ACTEXIT 0x08
159#define GIT_LOG_INST 0x10
160#define GIT_LOG_MSG 0x20
161#define GIT_LOG_DEBUG 0x40
162#define GIT_LOG_COMMS 0x80
163#define GIT_LOG_USER1 0x100
164#define GIT_LOG_USER2 0x200
165#define GIT_LOG_USER3 0x400
166#define GIT_LOG_USER4 0x800
167#define GIT_LOG_ARGS 0x1000
170#define GIT_LOG_ALWAYS 0x40000
171#define GIT_LOG_ALWAYS_S 0x80000
175/*
176 * Old users of gitlogger.h use the names below - which can be a problem since
177 * other systems may use them. Code that gets into problems can tell
178 * us not to define these names by defining the GIT_LOG_NO_OLD_NAMES
179 * macro before include gitlogger.h.
180 */
181
182#ifndef GIT_LOG_NO_OLD_NAMES
183#define LOG_ALL GIT_LOG_ALL
184#define LOG_STARTUP GIT_LOG_STARTUP
185#define LOG_ERRORS GIT_LOG_ERRORS
186#define LOG_ACTENT GIT_LOG_ACTENT
187#define LOG_ACTEXIT GIT_LOG_ACTEXIT
188#define LOG_INST GIT_LOG_INST
189#define LOG_MSG GIT_LOG_MSG
190#define LOG_DEBUG GIT_LOG_DEBUG
191#define LOG_COMMS GIT_LOG_COMMS
192#define LOG_USER1 GIT_LOG_USER1
193#define LOG_USER2 GIT_LOG_USER2
194#define LOG_USER3 GIT_LOG_USER3
195#define LOG_USER4 GIT_LOG_USER4
196#define LOG_ARGS GIT_LOG_ARGS
199#define LOG_ALWAYS GIT_LOG_ALWAYS
200#define LOG_ALWAYS_S GIT_LOG_ALWAYS_S
202#endif /* !defined GIT_LOG_NO_OLD_NAMES */
203
204
205
206
207#ifdef __cplusplus
208
209#include <stdio.h>
210#include <string>
211#include <DitsFix.h>
212
213/*
214 * Declare these here so they can be made friends of GitLogger.
215 */
216extern "C" FILE *GitLoggerFile(StatusType *status);
217extern "C" DVOID GitLoggerFlushAlways(int flag, StatusType *status);
218extern "C" DVOID GitLoggerTune(unsigned NewSettings,
219 unsigned *OldSettings,
220 StatusType *status);
221
222
223
224class GitLogger;
225
226/*
227 * This object fetches and formats the time. The UpdateTime() function
228 * updates the internal time and TimeToString() returns the formated
229 * time string.
230 */
232
233 private:
234 /*
235 * We keep about the formated time we last used - to avoid doing it again
236 * We also need the time itself - for which we use a "long int" to avoid
237 * having to include time.h for this module.
238 */
239 long int _LastTime; /* Last time we logged at */
240 int _millisec; /* milliseconds within the second */
241 char _timeStr[30]; /* Formated time string */
242 /* Experimental and debugging value - an offset added to all values
243 returned by time();
244 */
245 static long int _s_userTimeOffset; // User specified offset to apply (for debugging)
246#ifdef VxWorks
247 static bool _s_initialised;
248 static long int _s_ticksToTime; /* Add this to the number of seconds since
249 system boot to get the current Unix time */
250 static long int _s_clockRate;
251 bool _debugFlag; /* Object only debugging enabled */
252 static GitLogger___Time *_s_FirstObj; /* First object created - debug use only */
253
254 static void InitStatics(GitLogger___Time *obj);
255
256 long VxWorksUpdate(bool *timeJumpPossible,
257 const IMP_AbsTime *altTime);
258#endif
259
260 public:
262
263#ifdef VxWorks
264 static void DebugUpdate();
265#endif
266 /*
267 * Readout the current system time and update the internal time string. If
268 * altTime is non-zero, it is a pointer to a time to use instead of the
269 * current system time.
270 *
271 * If updateInternalTime is true, then the internal value kept for the
272 * last time is updated and the log file changed if appropiate. Otherwise
273 * only the string avialable to TimeString() is updated. We set this to
274 * false if we don't want to change the log file on a day change.
275 *
276 * day returns the current unix day (since 1 Jan 1970), but only
277 * if the time in seconds has changed in the last call, otherwise
278 * returns set to -1.
279 *
280 * timeJumpPossible is set true if the time may be about to change on the
281 * next log event - which can happen under VxWorks if the time is reset
282 * task which keeps the time synced with the other machines. Actually, could
283 * happen in any system but we only notice under VxWorks at the moment.
284 */
285 void UpdateTime(bool updateInternalTime,
286 int *day,
287 bool *timeJumpPossible,
288 const IMP_AbsTime *altTime);
289
290 /*
291 * Force UpdateTime to re-read the time on onext read. This is necessary to
292 * force a fetch of the day.
293 */
294 void Reset() {
295 _LastTime = 0;
296 }
297
298 /*
299 * Return the time string.
300 */
301 const char *TimeString() const { return _timeStr; };
302
303 /*
304 * Return the time itself.
305 */
306 long GetTime() const { return _LastTime; };
307 /*
308 * Return the milliseconds point within the second.
309 */
310 int Millisec() const { return _millisec; };
311 /*
312 * Set/Get the current time offset.
313 */
314 static void SetTimeOffset(long int t) { _s_userTimeOffset = t; }
315 static long int GetTimeOffset() { return _s_userTimeOffset; }
316
317
319
320};
321
322
496
497 friend DVOID GitLoggerFlushAlways(int flag, StatusType *status);
498 friend FILE *GitLoggerFile(StatusType *status);
499 friend DVOID GitLoggerTune(unsigned NewSettings,
500 unsigned *OldSettings,
501 StatusType *status);
502
503 private:
504 /*
505 * This internal object is used to fetch and format the time.
506 */
507 GitLogger___Time timer;
508
509 static const int SyncThreadRate = 5; /* How often in seconds the sync thead
510 runs */
511
512 /* Structure used to maintain level names */
513 typedef struct {
514 int minsig; unsigned level; const char *string;
515 } LevelStruct;
516
517 /*
518 * We need to define SemType and SemNull for each
519 * architecture. SemType is the type for a semaphore whilst
520 * SemNull is a value which indictes a semaphore is invalid
521 * The ControlSem item should be defined here but its definition
522 * is always the same ( it just needs to be here so that
523 * TakeSem() and GiveSem() can use it.
524 *
525 * We also need to define TakeSem() and GiveSem() for each
526 * architecture.
527 *
528 * Additionally, any architecture specific bits should be
529 * put here.
530 */
531# ifdef VxWorks
532 /*
533 * VxWorks background thread and sempahore.
534 */
535 typedef SEM_ID SemType;
536 static const SemType SemNull;
537 /*
538 * A semaphore used to control access to the log file when
539 * we use a background thread to write it.
540 */
541 SemType ControlSem;
542 /*
543 * Semaphore control. Architecture specific. If the background
544 * thread is not supported on an architecture, then these can
545 * be null routines.
546 */
547 void TakeSem(StatusType *status) {
548 if (*status != STATUS__OK) return;
549 if (ControlSem != SemNull)
550 semTake(ControlSem, WAIT_FOREVER);
551 }
552 void GiveSem(StatusType *status) const {
553 if (*status != STATUS__OK) ;
554 if (ControlSem != SemNull)
555 semGive(ControlSem);
556 }
557 void CreateSem(StatusType *status);
558 void DeleteSem();
559 int threadID; /* The background thread VxWorks task id */
560 int mainTaskID; /* The main task id */
561 public: /* so that SyncThreadStatic can access it */
562 void SyncThread(); /* Implementation method for background thread. */
563 private:
564
565# elif defined(GIT_USE_POSIX_THREADS)
566
567 typedef sem_t SemType; /* The type of a posix semaphore */
568 SemType ControlSemX; /* For sem_init() use */
569 SemType *ControlSemAddr; /* If using sem_init(), then &ControlSem,
570 if using sem_open(), return value from
571 sem_open() */
572 bool SemOk; /* Indicates if the semaphore was created ok*/
573 bool SemIsTaken; /* Indicates if the semaphore is taken */
574 bool ThreadOk; /* Was thread created ok */
575
576 sigset_t origSigMask; /* Signal mask at point semaphore is taken */
577
578 void TakeSem(StatusType *status) ;
579 void GiveSem(StatusType *status) ;
580 void CreateSem(StatusType *status);
581 void DeleteSem();
582
583 static void UserSignalHandler(int);
584
585
586 pthread_t syncThreadId;
587 pthread_t semThreadId;
588
589 std::string semName; /* Name if used named semaphore */
590
591 public: /* So that extern "C" linkage statics can access them */
592 void SyncThread(); /* Implementation method for background thread. */
593 void SyncThreadCleanup();
594 private:
595
596# else
597 /* Default values - architectures without a background thread */
598 typedef int SemType;
599 static const SemType SemNull = 0;
600 SemType ControlSem; /* Definition always the same */
601 void TakeSem(StatusType *) { };
602 void GiveSem(StatusType *) { };
603 void CreateSem(StatusType *) {};
604 void DeleteSem() {};
605# endif
606
607
608 static const LevelStruct LevelNames[];
609 static const char *RescheduleReasons[];
610 static const char *Requests[];
611 static const char *PathStatus[];
612 static const char *MessageTypes[];
613
614 /* Maximum length of messages */
615 static const int MsgLen;
616 static const char *LogFormat;
617 static const char *LogFormatTimed;
618 static const char *LogFormatHeader;
619
620 /* Current Logging levels - which goto the file and which to the screen.*/
621 unsigned FileLevels;
622 unsigned ScreenLevels;
623
624 /* If we true,then logging of MsgOut messages is disabled (since we
625 are using MsgOut to log to screen)
626 */
627 bool DisableMsgOut;
628
629 /* Log file */
630 FILE *LogFile;
631 std::string LogFileName;
632
633 /*
634 * LogDay contain the day number in the year. We use it to work
635 * out if the day has changed.
636 */
637 int LogDay;
638
639 /*
640 * Directory and system names supplied to constructor.
641 */
642 std::string directory;
643 std::string system;
644 /*
645 * Set true to always flush the log file.
646 */
647 bool flushAlways;
648 /*
649 * Set true to turn of fsync() operation when flusshing
650 */
651 bool noFsync;
652 /*
653 * Set true to disable LogFlush()
654 */
655 bool noLogFlush;
656 /*
657 * Are we trying to run the sync thread.
658 */
659 bool syncThreadRun;
660 /*
661 * Is the sync thread actually running
662 */
663 bool syncThreadIsRunning;
664 /*
665 * Set true when the log is flushed, cleared when messages
666 * are written.
667 */
668 bool flushed;
669
670 /*
671 * Last write to log file failed.
672 */
673 bool failed;
674 /*
675 * Are we compressing data on the fly (posix only)
676 */
677 bool compress;
678 /*
679 * This variable records the approimate file size - in particular, the
680 * amount of data we have written to the file using GitLogger::LogMessage(), the
681 * core logging routine. It does not record various bits of header information.
682 *
683 * We use this allow us to create a new log file every 512 MB - to avoid file system
684 * file size problems which occur at about 1 GB on older file systems..
685 */
686 INT32 fileSize;
687
688 /*
689 * Background sync thread initialisation/shutdown.
690 */
691 void SyncThreadStart(StatusType *status);
692 void SyncThreadStop();
693
694 /*
695 * Used to actually sync the log file.
696 */
697 void SyncFile(const char *from_where, StatusType *);
698 /*
699 * We need a static routine to implement the log level action
700 * which can then call the object routine Action.
701 */
702 static void LogLevelAction(StatusType *status);
703 void Action(StatusType *status);
704
705 /*
706 * static routines which are passed to DRAMA to implement the
707 * DRAMA logging system. See DitsSetLogSys().
708 */
709 static DVOID ActionEntryLog(DVOIDP client_data,StatusType *status);
710 static DVOID ActionReturnLog(
711 DVOIDP client_data,
712 int argDelete,
713 SdsIdType argOut,
714 DitsReqType request,
715 int delaySet,
716 DCONSTV DitsDeltaTimeType * delay,
717 StatusType exitStatus,
718 StatusType *status);
719 static DVOID GetPathLog(
720 DVOIDP client_data,
721 DCONSTV char * name,
722 DCONSTV char * node,
723 int flags,
724 DCONSTV DVOIDP info,
725 DitsPathType path,
726 DitsTransIdType transid,
727 StatusType * status);
728 static DVOID MsgSendLog(
729 DVOIDP client_data,
730 long int flags,
731 DitsPathType path,
732 DitsTransIdType transid,
733 DCONSTV DitsGsokMessageType * message,
734 StatusType *status);
735 static DVOID LoadLog(
736 DVOIDP client_data,
737 DCONSTV char * Machine,
738 DCONSTV char * TaskName,
739 DCONSTV char * ArgString,
740 long int Flags,
741 DCONSTV DitsTaskParamType * TaskParams,
742 DitsTransIdType transid,
743 StatusType *status);
744 static DVOID NotifyReqLog(
745 DVOIDP client_data,
746 int notifyRequested,
747 DitsPathType path,
748 DitsTransIdType transid,
749 StatusType *status);
750 static DVOID MsgOutLog(
751 DVOIDP client_data,
752 DCONSTV char * message,
753 StatusType *status);
754 static DVOID LogMsgLog(
755 DVOIDP client_data,
756 unsigned level,
757 DCONSTV char * prefix,
758 DCONSTV char * fmt,
759 va_list ap,
760 StatusType *status);
761
762 static DVOID LogTrigger(
763 DVOIDP client_data,
764 SdsIdType arg,
765 StatusType *status);
766
767 static DVOID LogTrigBulk(
768 DVOIDP client_data,
769 DCONSTV DVOIDP SharedMemInfo,
770 int sds,
771 int NotifyBytes,
772 DitsTransIdType transid,
773 StatusType *status);
774
775 static DVOID LogSignal(
776 DVOIDP client_data,
777 long int actptr,
778 DCONSTV DVOIDP ptr,
779 SdsIdType arg,
780 StatusType *status);
781
782 static DVOID LogBulkSend(
783 DVOIDP client_data,
784 DCONSTV long int flags,
785 DCONSTV DitsPathType path,
786 DCONSTV DVOIDP SharedMemInfo,
787 int NotifyBytes,
788 DitsTransIdType transid,
789 DCONSTV DitsGsokMessageType * message,
790 StatusType * status);
791
792
793 static DVOID ErsLog(DVOIDP logArg, DCONSTV ErsMessageType * message,
794 StatusType * status);
795 static DVOID LogShutdown(
796 DVOIDP client_data,
797 int taskShutdown,
798 StatusType *status);
799
800 static DVOID LogFlush(DVOIDP client_data, StatusType *status);
801 static DVOID LogInfo(DVOIDP client_data, StatusType *status);
802
803
804 /*
805 * The actual routine which logs to the file etc. If altTime is specified,
806 * then the log message is taged with that time, otherwise it is taged
807 * with the current time
808 */
809 void LogMessage(bool logToFile, bool logToScreen, const char *prefix,
810 const char *message, StatusType *status,
811 const IMP_AbsTime *altTime=0);
812
813
814 /*
815 * Function to set the logging levels from a string.
816 */
817 void SetLevels(const char *s, StatusType *status);
818 /* Functions to fetch logging levels. */
819 void GetLevels(std::string *s, StatusType *status);
820 void GetLevels(int stringLen, char *s, StatusType *status);
821 /* Support function for GetLevels */
822 void LevelCheckAndAdd(const unsigned index, std::string *const s);
823
824 void OpenLogFile(bool day_rollover, bool size, StatusType *status);
825 void OpenIt(const std::string &BaseLogFileName);
826 /* Check if the file size has got too large */
827 void CheckFileSize(StatusType *status);
828
829 /* Check if we should use compress mode */
830 void CheckCompressMode();
831 /* Close log file */
832 void CloseLogFile();
833
834 /* Create a new log file name */
835 static std::string NewName(const std::string &BaseLogFileName, int counter);
836
837 /* Has a log file named already been used */
838 static bool NameUsed(const std::string &name);
839 /*
840 * Assignemnt operation and Copy constructor made private
841 * to avoid misuse.
842 */
843 void operator=(const GitLogger&);
844 GitLogger(const GitLogger&);
845
846 /* Destructor - protected to prevent non-heap objects. */
847 protected:
848 ~GitLogger();
849
850
851 public:
852
870 GitLogger(const char *system, StatusType *status, const char *dir=0, bool compress=false);
871
877 void CheckDayChange(int newDay, StatusType *status);
878
879
886 static void SetTimeOffset(long int t){GitLogger___Time::SetTimeOffset(t); }
887
901 void Log(unsigned level, bool nofmt, const char *prefix,
902 StatusType *status, const char *fmt, ...)
903#ifdef __GNUC__
904 __attribute__ ((format (printf, 6, 7))) /* Note, method version of __attribute__ needs 1 added to each argument over non-method version. */
905#endif
906 ;
907
933 void Log(const IMP_AbsTime *time,
934 unsigned level, bool nofmt, const char *prefix,
935 StatusType *status, const char *fmt, ...)
936#ifdef __GNUC__
937 //DOES NOT WORK - WHY __attribute__ ((format (printf, 5, 6)))
938#endif
939 ;
940
949 void Set(unsigned newFileLevels, unsigned newScreenLevels,
950 StatusType *status);
951
960 void Unset(unsigned newFileLevels, unsigned newScreenLevels,
961 StatusType *status);
962
971 static GitLogger *GetLogger(StatusType * const status);
972
973
974};
975/* Now C level interfaces */
976extern "C" {
977#endif
984 DPUBLIC DVOID GitLoggerInit(const char *system,StatusType *status);
992 DPUBLIC FILE *GitLoggerFile(StatusType *status);
993
1002 DPUBLIC DVOID GitLoggerFlushAlways(int flag, StatusType *status);
1003
1004
1019#define GIT_LOGGER_M_NO_FSYNC 1 /* If set, don't fsync on flush */
1020#define GIT_LOGGER_M_FLUSH_ALWAYS 2 /* If set, flush on each event */
1021#define GIT_LOGGER_M_LOG_FLUSH_OFF 4 /* If set, don't flush on LogFlush() events,
1022 normally DitsMsgOut events */
1023#define GIT_LOGGER_M_SYNC_THRD_RUN 8 /* If set - run the sync thread */
1024#define GIT_LOGGER_M_SYNC_THRD_IS_RNNNG 16 /* Return only - if set - sync
1025 thread is running */
1026 DPUBLIC DVOID GitLoggerTune(unsigned NewSettings,
1027 unsigned *OldSettings,
1028 StatusType *status);
1029#ifdef __cplusplus
1030}
1031#endif
1032
1033#endif
Definition gitlogger.h:231
void Set(unsigned newFileLevels, unsigned newScreenLevels, StatusType *status)
Enable new logging levels.
friend FILE * GitLoggerFile(StatusType *status)
C interface to fetching the log file pointer.
static GitLogger * GetLogger(StatusType *const status)
Get the logger object.
void Log(const IMP_AbsTime *time, unsigned level, bool nofmt, const char *prefix, StatusType *status, const char *fmt,...)
Log a message with a specified event time.
void Unset(unsigned newFileLevels, unsigned newScreenLevels, StatusType *status)
Clear existing logging levels.
void Log(unsigned level, bool nofmt, const char *prefix, StatusType *status, const char *fmt,...)
Log a message.
GitLogger(const char *system, StatusType *status, const char *dir=0, bool compress=false)
Construct a GitLogger object.
static void SetTimeOffset(long int t)
Change the time offset.
Definition gitlogger.h:886
friend void GitLoggerFlushAlways(int flag, StatusType *status)
C interface to setting the GitLogger flush flag.
void CheckDayChange(int newDay, StatusType *status)
Internal use only.
Implementation of a Class supporting Logging with a DRAMA GIT Task.
Definition gitlogger.h:495
FILE * GitLoggerFile(StatusType *status)
C interface to fetching the log file pointer.
void GitLoggerFlushAlways(int flag, StatusType *status)
C interface to setting the GitLogger flush flag.
void GitLoggerInit(const char *system, StatusType *status)
C interface to enabling a Git logger.