Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2013, 11:13:03 PM (11 years ago)
Author:
landauf
Message:

merged testing branch back to trunk. unbelievable it took me 13 months to finish this chore…

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/util/output/LogWriter.h

    r8858 r9550  
    4747        @brief The LogWriter class inherits from BaseWriter and writes output to a log-file.
    4848
    49         It is implemented as singleton because we (currently) use only one
    50         log-file. The path of the file can be changed, in which case the file
     49        The path of the file can be changed, in which case the file
    5150        is rewritten by using the output stored by MemoryWriter. This adds the
    5251        possibility to change the desired output levels before changing the
     
    5756    {
    5857        public:
    59             static LogWriter& getInstance();
     58            LogWriter();
     59            LogWriter(const LogWriter&);
     60            virtual ~LogWriter();
    6061
    61             void setLogPath(const std::string& path);
     62            void setLogDirectory(const std::string& directory);
     63
     64            /** @brief Returns the path to the logfile. */
     65            inline std::string getPath() const
     66                { return this->directory_ + '/' + this->filename_; }
     67            /** @brief Returns the open file stream. */
     68            inline const std::ofstream& getFile() const
     69                { return this->file_; }
    6270
    6371        protected:
     
    6573
    6674        private:
    67             LogWriter();
    68             LogWriter(const LogWriter&);
    69             virtual ~LogWriter();
    70 
    7175            void openFile();
    7276            void closeFile();
    7377
    74             std::string filename_;  ///< The name of the log-file (without directories)
    75             std::string path_;      ///< The path of the log-file (without file-name)
    76             bool bDefaultPath_;     ///< If true, the log-file resides at the default path (which is usually a temporary directory)
     78            void archive(int index = 0);
     79            std::string getArchivedPath(int index) const;
    7780
     81            std::string filename_;  ///< The name of the log-file (without directory)
     82            std::string directory_; ///< The directory where the log-file resided (without file-name)
    7883            std::ofstream file_;    ///< The output file stream.
    7984    };
Note: See TracChangeset for help on using the changeset viewer.