StelLogger.hpp   StelLogger.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef STELLOGGER_HPP #ifndef STELLOGGER_HPP
#define STELLOGGER_HPP #define STELLOGGER_HPP
#include "config.h"
#include <QString> #include <QString>
#include <QFile> #include <QFile>
//! @class StelLogger //! @class StelLogger
//! Class wit only static members used to manage logging for Stellarium. //! Class wit only static members used to manage logging for Stellarium.
//! The debugLogHandler() method allow to defined it as a standard Qt messa ges handler //! The debugLogHandler() method allow to defined it as a standard Qt messa ges handler
//! which is then used by qDebug, qWarning and qFatal. //! which is then used by qDebug, qWarning and qFatal.
class StelLogger class StelLogger
{ {
public: public:
//! Create and initialize the log file. //! Create and initialize the log file.
//! Prepend system information before any debugging output. //! Prepend system information before any debugging output.
static void init(const QString& logFilePath); static void init(const QString& logFilePath);
//! Deinitialize the log file. //! Deinitialize the log file.
//! Must be called after init() was called. //! Must be called after init() was called.
static void deinit(); static void deinit();
//! Handler for qDebug() and friends. Writes message to log file at $USERDIR/log.txt and echoes to stderr. //! Handler for qDebug() and friends. Writes message to log file at $USERDIR/log.txt and echoes to stderr.
static void debugLogHandler(QtMsgType, const char*); static void debugLogHandler(QtMsgType, const QMessageLogContext&, co nst QString& str);
//! Return a copy of text of the log file. //! Return a copy of text of the log file.
static const QString& getLog() {return log;} static const QString& getLog() {return log;}
static QString getLogFileName() {return logFile.fileName();} static QString getLogFileName() {return logFile.fileName();}
//! Write the message plus a newline to the log file at $USERDIR/log .txt. //! Write the message plus a newline to the log file at $USERDIR/log .txt.
//! @param msg message to write. //! @param msg message to write.
//! If you call this function the message will be only in the log fi le, //! If you call this function the message will be only in the log fi le,
//! not on the console like with qDebug(). //! not on the console like with qDebug().
static void writeLog(QString msg); static void writeLog(QString msg);
private: private:
static QFile logFile; static QFile logFile;
static QString log; static QString log;
static QString getMsvcVersionString(int ver);
}; };
#endif // STELLOGGER_HPP #endif // STELLOGGER_HPP
 End of changes. 3 change blocks. 
1 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/