1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef UPDATELOGGING_H
6 #define UPDATELOGGING_H
8 #include "updatedefines.h"
14 static UpdateLog
& GetPrimaryLog()
16 static UpdateLog primaryLog
;
20 void Init(NS_tchar
* sourcePath
, const NS_tchar
* fileName
,
21 const NS_tchar
* alternateFileName
, bool append
);
24 void Printf(const char *fmt
, ... );
25 void WarnPrintf(const char *fmt
, ... );
38 #define LOG_WARN(args) UpdateLog::GetPrimaryLog().WarnPrintf args
39 #define LOG(args) UpdateLog::GetPrimaryLog().Printf args
40 #define LogInit(PATHNAME_, FILENAME_) \
41 UpdateLog::GetPrimaryLog().Init(PATHNAME_, FILENAME_, 0, false)
42 #define LogInitAppend(PATHNAME_, FILENAME_, ALTERNATE_) \
43 UpdateLog::GetPrimaryLog().Init(PATHNAME_, FILENAME_, ALTERNATE_, true)
44 #define LogFinish() UpdateLog::GetPrimaryLog().Finish()
45 #define LogFlush() UpdateLog::GetPrimaryLog().Flush()