로딩중...
검색중...
일치하는것 없음
by::logger 클래스 참조

Main logging interface for the byeol language system 더 자세히 ...

#include <logger.hpp>

by::logger에 대한 상속 다이어그램 :
by::stream

Public 멤버 함수

streamgetStream (nidx n)
 
const streamgetStream (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 filtersgetFilters () 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 loggerget ()
 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.

Usage

Basic usage with macros:

BY_I("pods[%s] origins loaded.", getName());

This produces output like:

Pod
Definition pod.hpp:21
Rich logging support with polymorphic type conversion
Definition richLog.hpp:34

The log shows:

  1. Date (Oct 22 2025) and time (21:26:13)
  2. Log level (I for Info) - ERR, WARN, INFO are available
  3. Class name (cppPodLoading, abbreviated)
  4. Function (_loadLibs) and line number (49)
  5. Log message (pod[cpp] origins loaded)

stream

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:

RELEASED ---init()---> INITIALIZED
RELEASED <--rel()----- INITIALIZED

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.

macro

Use logging macros for advanced features like filename, function name, and line numbers:

BY_I("just message.");
BY_DE("leaf: ERR: %s", e); // Debug-only error log with format specifiers

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).

richLog

The richLog feature uses polymorphism to convert format specifier arguments to appropriate types:

BY_I("make a closure for %s.%s", meObj, cast.getSrc().getName());

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.

filterable

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.

멤버 함수 문서화

◆ getName()

const std::string & by::logger::getName ( ) const
overridevirtual

by::stream를 구현.

◆ isInit()

nbool by::logger::isInit ( ) const
overridevirtual

by::stream(으)로부터 재구현되었습니다.

◆ log()

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

반환값
true on success, false on error

◆ logBypass()

nbool by::logger::logBypass ( const nchar * message)
overridevirtual

Log message bypassing normal filtering

반환값
true on success, false on error

by::stream(으)로부터 재구현되었습니다.

◆ logFormatBypass()

nbool by::logger::logFormatBypass ( const nchar * fmt,
... )

Logs formatted message bypassing rich logging conversion

반환값
true on success, false on error

◆ pushStream() [1/2]

nbool by::logger::pushStream ( stream & new_stream)

Adds a new logging stream to the logger.

매개변수
new_streamReference to the stream to add.
반환값
true on success, false on error (e.g., stream already added or invalid).

◆ pushStream() [2/2]

nbool by::logger::pushStream ( stream * new_stream)

Adds a new logging stream to the logger

반환값
true on success, false on error

Adds a new logging stream to the logger.

매개변수
new_streamPointer to the stream to add.
반환값
true on success, false on error (e.g., stream already added or invalid).

◆ setEnable()

void by::logger::setEnable ( nbool enable)
overridevirtual

by::stream(으)로부터 재구현되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: