1 /*
2  * Copyright (c) 2022 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 NWEB_CONSOLE_LOG_H
17 #define NWEB_CONSOLE_LOG_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "nweb_export.h"
23 
24 namespace OHOS::NWeb {
25 
26 class OHOS_NWEB_EXPORT NWebConsoleLog {
27 public:
28     enum NWebConsoleLogLevel { DEBUG = 1, INFO, WARNING, ERROR, UNKNOWN };
29 
30     virtual ~NWebConsoleLog() = default;
31 
32     /**
33      * @brief Get console log line number
34      *
35      * @retval line number
36      */
37     virtual int LineNumer() = 0;
38 
39     /**
40      * @brief Get console log message
41      *
42      * @retval message
43      */
44     virtual std::string Log() = 0;
45 
46     /**
47      * @brief Get console log message level
48      *
49      * @retval message level
50      */
51     virtual NWebConsoleLogLevel LogLevel() = 0;
52 
53     /**
54      * @brief Get console log source id
55      *
56      * @retval source id
57      */
58     virtual std::string SourceId() = 0;
59 };
60 
61 } // namespace OHOS::NWeb
62 
63 #endif // NWEB_CONSOLE_LOG_H