Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
LogHelper.h
浏览该文件的文档.
1// Copyright 2024 libsese
2//
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
21#pragma once
22#include <sese/record/Logger.h>
23#include <sese/record/Event.h>
24
25namespace sese::record {
29class LogHelper {
30public:
31 using Ptr = std::shared_ptr<LogHelper>;
32
33public:
34 static void d(const char *format, ...) noexcept;
35 static void i(const char *format, ...) noexcept;
36 static void w(const char *format, ...) noexcept;
37 static void e(const char *format, ...) noexcept;
38
39public:
43 explicit LogHelper();
44
46 void debug(const char *format, ...);
48 void info(const char *format, ...);
50 void warn(const char *format, ...);
52 void error(const char *format, ...);
53
56 // void debug(const char *file, int32_t line, const char *format, ...);
59 // void info(const char *file, int32_t line, const char *format, ...);
62 // void warn(const char *file, int32_t line, const char *format, ...);
65 // void error(const char *file, int32_t line, const char *format, ...);
66
67private:
68 static void l(Level level, const char *file, int32_t line, const char *format, va_list ap);
69 void log(Level level, const char *file, int32_t line, const char *format, va_list ap);
70
71 Logger *logger = nullptr;
72};
73} // namespace sese::record