• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /* This files contains header of faultlog config module. */
17 
18 #ifndef _FAULT_LOGGER_CONFIG_H
19 #define _FAULT_LOGGER_CONFIG_H
20 
21 #include <string>
22 #include "iosfwd"
23 
24 constexpr int LOG_FILE_NUMBER = 50;
25 constexpr long LOG_FILE_SIZE = 1 * 1024 * 1024;
26 const std::string LOG_FILE_PATH = "/data/log/faultlog/temp";
27 const std::string DEBUG_LOG_FILE_PATH = "/data/log/faultlog/debug";
28 
29 namespace OHOS {
30 namespace HiviewDFX {
31 class FaultLoggerConfig {
32 public:
33     FaultLoggerConfig(const int number, const long size, const std::string& path, const std::string& debugPath);
34     ~FaultLoggerConfig();
35     int GetLogFileMaxNumber() const;
36     bool SetLogFileMaxNumber(const int number);
37     long GetLogFileMaxSize() const;
38     bool SetLogFileMaxSize(const long size);
39     std::string GetLogFilePath() const;
40     bool SetLogFilePath(const std::string& path);
41     bool SetDebugLogFilePath(const std::string& path);
42     std::string GetDebugLogFilePath() const;
43 
44 private:
45     int logFileNumber_;
46     long logFileSize_;
47     std::string logFilePath_;
48     std::string debugLogFilePath_;
49 };
50 } // namespace HiviewDFX
51 } // namespace OHOS
52 
53 #endif
54