2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_CRONOLOG_H_
18 #define incl_HPHP_CRONOLOG_H_
25 #include <folly/portability/Stdlib.h>
27 #include "hphp/util/cronoutils.h"
28 #include "hphp/util/log-file-flusher.h"
31 ///////////////////////////////////////////////////////////////////////////////
35 Cronolog(const Cronolog
&) = delete;
36 Cronolog
& operator=(const Cronolog
&) = delete;
38 if (m_prevFile
) fclose(m_prevFile
);
39 if (m_file
) fclose(m_file
);
41 void setPeriodicity();
42 FILE* getOutputFile();
43 static void changeOwner(const std::string
& username
,
44 const std::string
& symlink
);
45 PERIODICITY m_periodicity
{UNKNOWN
};
46 PERIODICITY m_periodDelayUnits
{UNKNOWN
};
47 int m_periodMultiple
{1};
49 int m_useAmericanDateFormats
{0};
50 char m_fileName
[PATH_MAX
];
51 char* m_startTime
{nullptr};
52 std::string m_template
;
53 std::string m_linkName
;
54 char* m_prevLinkName
{nullptr};
55 time_t m_timeOffset
{0};
56 time_t m_nextPeriod
{0};
57 FILE* m_prevFile
{nullptr};
58 FILE* m_file
{nullptr};
59 LogFileFlusher flusher
;
63 ///////////////////////////////////////////////////////////////////////////////
66 #endif // incl_HPHP_CRONOLOG_H_