499 friend DVOID GitLoggerTune(
unsigned NewSettings,
500 unsigned *OldSettings,
509 static const int SyncThreadRate = 5;
514 int minsig;
unsigned level;
const char *string;
535 typedef SEM_ID SemType;
536 static const SemType SemNull;
547 void TakeSem(StatusType *status) {
548 if (*status != STATUS__OK)
return;
549 if (ControlSem != SemNull)
550 semTake(ControlSem, WAIT_FOREVER);
552 void GiveSem(StatusType *status)
const {
553 if (*status != STATUS__OK) ;
554 if (ControlSem != SemNull)
557 void CreateSem(StatusType *status);
565# elif defined(GIT_USE_POSIX_THREADS)
567 typedef sem_t SemType;
569 SemType *ControlSemAddr;
576 sigset_t origSigMask;
578 void TakeSem(StatusType *status) ;
579 void GiveSem(StatusType *status) ;
580 void CreateSem(StatusType *status);
583 static void UserSignalHandler(
int);
586 pthread_t syncThreadId;
587 pthread_t semThreadId;
593 void SyncThreadCleanup();
599 static const SemType SemNull = 0;
601 void TakeSem(StatusType *) { };
602 void GiveSem(StatusType *) { };
603 void CreateSem(StatusType *) {};
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[];
615 static const int MsgLen;
616 static const char *LogFormat;
617 static const char *LogFormatTimed;
618 static const char *LogFormatHeader;
622 unsigned ScreenLevels;
631 std::string LogFileName;
642 std::string directory;
663 bool syncThreadIsRunning;
691 void SyncThreadStart(StatusType *status);
692 void SyncThreadStop();
697 void SyncFile(
const char *from_where, StatusType *);
702 static void LogLevelAction(StatusType *status);
703 void Action(StatusType *status);
709 static DVOID ActionEntryLog(DVOIDP client_data,StatusType *status);
710 static DVOID ActionReturnLog(
716 DCONSTV DitsDeltaTimeType * delay,
717 StatusType exitStatus,
719 static DVOID GetPathLog(
726 DitsTransIdType transid,
727 StatusType * status);
728 static DVOID MsgSendLog(
732 DitsTransIdType transid,
733 DCONSTV DitsGsokMessageType * message,
735 static DVOID LoadLog(
737 DCONSTV
char * Machine,
738 DCONSTV
char * TaskName,
739 DCONSTV
char * ArgString,
741 DCONSTV DitsTaskParamType * TaskParams,
742 DitsTransIdType transid,
744 static DVOID NotifyReqLog(
748 DitsTransIdType transid,
750 static DVOID MsgOutLog(
752 DCONSTV
char * message,
754 static DVOID LogMsgLog(
757 DCONSTV
char * prefix,
762 static DVOID LogTrigger(
767 static DVOID LogTrigBulk(
769 DCONSTV DVOIDP SharedMemInfo,
772 DitsTransIdType transid,
775 static DVOID LogSignal(
782 static DVOID LogBulkSend(
784 DCONSTV
long int flags,
785 DCONSTV DitsPathType path,
786 DCONSTV DVOIDP SharedMemInfo,
788 DitsTransIdType transid,
789 DCONSTV DitsGsokMessageType * message,
790 StatusType * status);
793 static DVOID ErsLog(DVOIDP logArg, DCONSTV ErsMessageType * message,
794 StatusType * status);
795 static DVOID LogShutdown(
800 static DVOID LogFlush(DVOIDP client_data, StatusType *status);
801 static DVOID LogInfo(DVOIDP client_data, StatusType *status);
809 void LogMessage(
bool logToFile,
bool logToScreen,
const char *prefix,
810 const char *message, StatusType *status,
811 const IMP_AbsTime *altTime=0);
817 void SetLevels(
const char *s, StatusType *status);
819 void GetLevels(std::string *s, StatusType *status);
820 void GetLevels(
int stringLen,
char *s, StatusType *status);
822 void LevelCheckAndAdd(
const unsigned index, std::string *
const s);
824 void OpenLogFile(
bool day_rollover,
bool size, StatusType *status);
825 void OpenIt(
const std::string &BaseLogFileName);
827 void CheckFileSize(StatusType *status);
830 void CheckCompressMode();
835 static std::string NewName(
const std::string &BaseLogFileName,
int counter);
838 static bool NameUsed(
const std::string &name);
870 GitLogger(
const char *system, StatusType *status,
const char *dir=0,
bool compress=
false);
901 void Log(
unsigned level,
bool nofmt,
const char *prefix,
902 StatusType *status,
const char *fmt, ...)
904 __attribute__ ((format (printf, 6, 7)))
933 void Log(
const IMP_AbsTime *time,
934 unsigned level,
bool nofmt,
const char *prefix,
935 StatusType *status,
const char *fmt, ...)
949 void Set(
unsigned newFileLevels,
unsigned newScreenLevels,
960 void Unset(
unsigned newFileLevels,
unsigned newScreenLevels,
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.