ILogger.h

本文介绍了一个名为 ILogger 的日志接口,该接口定义了不同级别的日志记录功能,包括信息、警告和错误等。通过设置不同的日志级别,可以控制记录的信息类型。此外,还详细说明了如何使用此接口来打印不同类型的日志信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/*

* ILogger.h

*

* Created on: 2010-10-11

* Author: Mido

* 日志

* - 来自于大哥irrlicht

*/

 

#ifndef ILOGGER_H_

#define ILOGGER_H_

 

#include "IReferenceCounted.h"

 

namespace irrlight

{

 

//! Possible log levels.

enum ELOG_LEVEL

{

//! High log level, warnings, errors and important information texts are printed out.

ELL_INFORMATION = 0,

 

//! Default log level, warnings and errors are printed out

ELL_WARNING,

 

//! Low log level, only errors are printed into the log

ELL_ERROR,

 

//! Nothing is printed out to the log

ELL_NONE

};

 

 

//! Interface for logging messages, warnings and errors

class ILogger : public virtual IReferenceCounted

{

public:

 

//! Destructor

virtual ~ILogger() {}

 

//! Returns the current set log level.

virtual ELOG_LEVEL getLogLevel() const = 0;

 

//! Sets a new log level.

/** With this value, texts which are sent to the logger are filtered

out. For example setting this value to ELL_WARNING, only warnings and

errors are printed out. Setting it to ELL_INFORMATION, which is the

default setting, warnings, errors and informational texts are printed

out.

/param ll: new log level filter value. */

virtual any setLogLevel(ELOG_LEVEL ll) = 0;

 

//! Prints out a text into the log

/** /param text: Text to print out.

/param ll: Log level of the text. If the text is an error, set

it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it

is just an informational text, set it to ELL_INFORMATION. Texts are

filtered with these levels. If you want to be a text displayed,

independent on what level filter is set, use ELL_NONE. */

virtual any log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;

 

//! Prints out a text into the log

/** /param text: Text to print out.

/param hint: Additional info. This string is added after a " :" to the

string.

/param ll: Log level of the text. If the text is an error, set

it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it

is just an informational text, set it to ELL_INFORMATION. Texts are

filtered with these levels. If you want to be a text displayed,

independent on what level filter is set, use ELL_NONE. */

virtual any log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;

 

//! Prints out a text into the log

/** /param text: Text to print out.

/param hint: Additional info. This string is added after a " :" to the

string.

/param ll: Log level of the text. If the text is an error, set

it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it

is just an informational text, set it to ELL_INFORMATION. Texts are

filtered with these levels. If you want to be a text displayed,

independent on what level filter is set, use ELL_NONE. */

virtual any log(const c16* text, const c16* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;

 

//! Prints out a text into the log

/** /param text: Text to print out.

/param ll: Log level of the text. If the text is an error, set

it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it

is just an informational text, set it to ELL_INFORMATION. Texts are

filtered with these levels. If you want to be a text displayed,

independent on what level filter is set, use ELL_NONE. */

virtual any log(const c16* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;

};

 

} // end namespace

 

#endif /* ILOGGER_H_ */

 

 

 

本文来自:鬼火神灯 - irrlight.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值