• 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 #ifndef PROPERTIES_H
17 #define PROPERTIES_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace HiviewDFX {
23 
24 bool IsOnceDebugOn();
25 bool IsPersistDebugOn();
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 bool IsDebugOn();
31 bool IsPrivateSwitchOn();
32 
33 #ifdef __cplusplus
34 }
35 #endif
36 bool IsDebuggableHap();
37 uint16_t GetGlobalLogLevel();
38 uint16_t GetGlobalLevel();
39 uint16_t GetPersistGlobalLevel();
40 uint16_t GetDomainLevel(uint32_t domain);
41 uint16_t GetPersistDomainLevel(uint32_t domain);
42 uint16_t GetTagLevel(const std::string& tag);
43 uint16_t GetPersistTagLevel(const std::string& tag);
44 bool IsProcessSwitchOn();
45 bool IsDomainSwitchOn();
46 bool IsKmsgSwitchOn();
47 size_t GetBufferSize(uint16_t type, bool persist);
48 int GetProcessQuota(const std::string& proc);
49 int GetDomainQuota(uint32_t domain);
50 bool IsStatsEnable();
51 bool IsTagStatsEnable();
52 
53 int SetPrivateSwitchOn(bool on);
54 int SetOnceDebugOn(bool on);
55 int SetPersistDebugOn(bool on);
56 int SetGlobalLevel(uint16_t lvl);
57 int SetPersistGlobalLevel(uint16_t lvl);
58 int SetTagLevel(const std::string& tag, uint16_t lvl);
59 int SetPersistTagLevel(const std::string& tag, uint16_t lvl);
60 int SetDomainLevel(uint32_t domain, uint16_t lvl);
61 int SetPersistDomainLevel(uint32_t domain, uint16_t lvl);
62 int SetProcessSwitchOn(bool on);
63 int SetDomainSwitchOn(bool on);
64 int SetKmsgSwitchOn(bool on);
65 int SetBufferSize(uint16_t type, bool persist, size_t size);
66 } // namespace HiviewDFX
67 } // namespace OHOS
68 #endif
69