Line data Source code
1 : /*
2 : * If not stated otherwise in this file or this component's LICENSE file the
3 : * following copyright and licenses apply:
4 : *
5 : * Copyright 2023 Sky UK
6 : *
7 : * Licensed under the Apache License, Version 2.0 (the "License");
8 : * you may not use this file except in compliance with the License.
9 : * You may obtain a copy of the License at
10 : *
11 : * http://www.apache.org/licenses/LICENSE-2.0
12 : *
13 : * Unless required by applicable law or agreed to in writing, software
14 : * distributed under the License is distributed on an "AS IS" BASIS,
15 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 : * See the License for the specific language governing permissions and
17 : * limitations under the License.
18 : *
19 : * @file ILogHandler.h
20 : *
21 : * This file comprises the class definition of ILogHandler.
22 : * An interface, which provides API of custom server manager logging handler
23 : */
24 :
25 : #ifndef RIALTO_SERVERMANAGER_SERVICE_I_LOG_HANDLER_H_
26 : #define RIALTO_SERVERMANAGER_SERVICE_I_LOG_HANDLER_H_
27 :
28 : #include <string>
29 :
30 : namespace rialto::servermanager::service
31 : {
32 : class ILogHandler
33 : {
34 : public:
35 1 : ILogHandler() = default;
36 1 : virtual ~ILogHandler() = default;
37 : ILogHandler(const ILogHandler &) = delete;
38 : ILogHandler &operator=(const ILogHandler &) = delete;
39 : ILogHandler(ILogHandler &&) = delete;
40 : ILogHandler &operator=(ILogHandler &&) = delete;
41 :
42 : enum class Level
43 : {
44 : Fatal,
45 : Error,
46 : Warning,
47 : Milestone,
48 : Info,
49 : Debug,
50 : External
51 : };
52 :
53 : virtual void log(Level level, const std::string &file, int line, const std::string &function,
54 : const std::string &message) const = 0;
55 : };
56 : } // namespace rialto::servermanager::service
57 :
58 : #endif // RIALTO_SERVERMANAGER_SERVICE_I_LOG_HANDLER_H_
|