Main logging interface for the byeol language system 더 자세히 ...
#include <logger.hpp>
Public 멤버 함수 | |
| stream * | getStream (nidx n) |
| const stream * | getStream (nidx n) const BY_CONST_FUNC(getStream(n)) stream *getStream(const nchar *msg) |
| void | setEnable (nbool enable) override |
| enables | getEnables () const |
| void | setEnables (const enables &enbs) |
| ncnt | getStreamCount () const |
| nbool | logFormatBypass (const nchar *fmt,...) |
| Logs formatted message bypassing rich logging conversion | |
| nbool | log (errLv::level lv, const std::string &filename, const nchar *func, int line, const nchar *fmt,...) |
| Main logging function with full context information | |
| nbool | pushStream (stream *new_stream) |
| Adds a new logging stream to the logger | |
| nbool | pushStream (stream &new_stream) |
| Adds a new logging stream to the logger. | |
| const std::string & | getName () const override |
| nbool | logBypass (const nchar *message) override |
| Log message bypassing normal filtering | |
| nbool | isInit () const override |
| void | setFilters (const filters &newFilters) |
| Set logging filters | |
| void | setFilters () |
| Reset filters to default | |
| const filters & | getFilters () const |
by::stream(으)로부터 상속된 Public 멤버 함수 | |
| stream (nbool isEnable=true) | |
| nbool | logBypass (const std::string &message) |
| nbool | isNull () const |
| Checks if this stream is a null object. | |
| virtual nbool | isEnable () const |
정적 Public 멤버 함수 | |
| static logger & | get () |
| Get singleton logger instance | |
Public 속성 | |
| const stream *getStream(const nchar *msg) const BY_CONST_FUNC(getStream(msg)) stream *getStream(const std const stream | getStream )(const std::string &msg) const BY_CONST_FUNC(getStream(msg)) nbool isEnable() const override |
Main logging interface for the byeol language system
A lightweight C++ logging framework facade that enables systematic logging through multiple logging destinations called stream. Typically used through accompanying macros.
Basic usage with macros:
This produces output like:
The log shows:
The core of the clog module is stream. A stream represents the logging output destination. Currently consoleStream and fileLogStream exist. All streams are owned by the logger class from the start.
Each stream follows the standard byeol state diagram:
Streams also manage enable status. Using setEnable(false) disables a specific stream. The logger class itself inherits from stream, so it provides the same API. Logger redirects each API call to all owned streams. For example, logger::get().setEnable(false) disables all streams.
Use logging macros for advanced features like filename, function name, and line numbers:
Macros follow byeol convention with BY_ prefix, followed by log level (E/W/I). Add D prefix for debug-only logs (e.g., BY_DE, BY_DW, BY_DI).
The richLog feature uses polymorphism to convert format specifier arguments to appropriate types:
Output: Oct 22 2025 22:01:12 I closure <_make#73> make a closure for obj.foo
Both tstr<obj> and std::string are properly converted to strings. Since clog is a low-level module in the architecture, richLog is defined per-module to handle module-specific class conversions.
Log messages can be filtered based on specific conditions. The filterable interface's filt() function determines filtering. Add filters using setFilters(const filters&). For example, errPassFilter only passes ERR level messages.
|
overridevirtual |
by::stream를 구현.
|
overridevirtual |
by::stream(으)로부터 재구현되었습니다.
| nbool by::logger::log | ( | errLv::level | lv, |
| const std::string & | filename, | ||
| const nchar * | func, | ||
| int | line, | ||
| const nchar * | fmt, | ||
| ... ) |
Main logging function with full context information
|
overridevirtual |
Log message bypassing normal filtering
by::stream(으)로부터 재구현되었습니다.
| nbool by::logger::logFormatBypass | ( | const nchar * | fmt, |
| ... ) |
Logs formatted message bypassing rich logging conversion
| nbool by::logger::pushStream | ( | stream & | new_stream | ) |
Adds a new logging stream to the logger.
| new_stream | Reference to the stream to add. |
| nbool by::logger::pushStream | ( | stream * | new_stream | ) |
Adds a new logging stream to the logger
Adds a new logging stream to the logger.
| new_stream | Pointer to the stream to add. |
|
overridevirtual |
by::stream(으)로부터 재구현되었습니다.