comparison Utils/LogFile.h @ 1:0b3630a29ad8

Initial version based on previous repository. Project was ported to QT6 and in now cmake based.
author Ideenmodellierer <tiefenrauscher@web.de>
date Thu, 27 Nov 2025 18:40:28 +0100
parents
children
comparison
equal deleted inserted replaced
0:76ccd6ce50c0 1:0b3630a29ad8
1 //////////////////////////////////////////////////////////////////////////////
2 /// \file LogFile.h
3 /// \brief Put Log message into a log file.
4 /// \author JD Gascuel.
5 /// \copyright (c) 2011-2016 JD Gascuel. All rights reserved.
6 /// $Id$
7 //////////////////////////////////////////////////////////////////////////////
8 //
9 // BSD 2-Clause License:
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions
13 // are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 // THE POSSIBILITY OF SUCH DAMAGE.
33 //
34 //////////////////////////////////////////////////////////////////////////////
35 // HISTORY
36 // 2013-11-15 jDG: Creation.
37 // 2016-05-24 jDG: BSD-2 version.
38
39 #ifndef LOGAPPENDERROLLINGFILE_H
40 #define LOGAPPENDERROLLINGFILE_H
41
42 #include "Utils/LogAppender.h"
43 #include <stdio.h>
44
45 class QSettings;
46
47 //////////////////////////////////////////////////////////////////////////////
48 class EXPORT LogFile
49 : public LogAppender
50 {
51 int _holdFiles;
52 QString _fileNameFormat;
53 FILE* _logFile;
54
55 public:
56 LogFile(int argc, char *argv[]);
57 ~LogFile() override;
58
59 virtual QString filePath(bool pattern = false) const;
60 virtual void cleanup();
61
62 const char* type() const override;
63 void operator ()(const Log &log) override;
64 const char *defaultFormat() const override;
65 Log::Level defaultMinLevel() const override;
66 };
67
68 #endif // LOGAPPENDERROLLINGFILE_H