{endcode} {subsection: Current API of the individual logging methods} -TODO +---------------------------------- +User Log: +---------------------------------- + +Writer- and Reader-class : WriteUserLog and ReadUserLog + +- WriteUserLog + + May be global, may write out as XML + + - Instantiation: + WriteUserLog(const char *owner, const char *domain, const char *file, + int clu, int proc, int subp, bool xml = XML_USERLOG_DEFAULT, + const char *gjid = NULL); + + WriteUserLog(const char *owner, const char *file, + int clu, int proc, int subp, bool xml = XML_USERLOG_DEFAULT); + + Also empty constructor possible, but that means that initialization has to be done separately. + + - Usage: + bool writeEvent (ULogEvent *event, ClassAd *jobad = NULL, + bool *written = NULL ); + + Problem: This function returns success, even if no initialization was made (and therefore nothing was written) + + - Locking: + - in write process: + FileLockBase: lock on file is obtained + lock is released upon completion + + + private function for writing/locking: doWriteEvent(...) + + + - Rotation: + int doRotation( const char *path, FILE *&fp, + MyString &rotated, int max_rotations ); + + log files are named <name>.x, where <name>.1 is the most recently created file (apart from simply <name>, which is the current log file) + A rename has to take place for all existing archived log files for every rotation. {subsection: Current semantics} TODO