Aspose::Email::Tools::Logging::Logger Class Referencefinal

Provides the logging functionality. More...

Inherits IDisposable.

Public Member Functions

System::SharedPtr< LogLevelget_Severity () const
 Gets severity. More...
 
void set_Severity (System::SharedPtr< LogLevel > value)
 Sets severity. More...
 
System::String get_Name () const
 Gets name. More...
 
System::SharedPtr< AppenderCollectionget_Appenders () const
 Gets the appender list. More...
 
void set_Appenders (System::SharedPtr< AppenderCollection > value)
 Sets the appender list. More...
 
 Logger ()
 
 Logger (System::String name, System::SharedPtr< LogLevel > severity, const System::ArrayPtr< System::SharedPtr< IAppender >> &appender)
 
bool IsEnabled (System::SharedPtr< LogLevel > level)
 Determines if logging is enabled for the specified level. More...
 
void WriteLine ()
 Writes the empty line to appenders. More...
 
void WriteLine (System::String message)
 Writes the specified message to appenders. More...
 
void WriteLine (System::SharedPtr< System::Object > message)
 Writes the specified message to appenders. More...
 
void WriteFormat (System::String format, const System::ArrayPtr< System::SharedPtr< System::Object >> &arguments)
 Writes the message with specified format to appenders. More...
 
void Write (System::String message)
 Writes the specified message to appenders. More...
 
void Write (System::String message, System::Exception exception)
 Writes the specified message and exception to appenders. More...
 
void Write (System::String message, System::Exception ex, System::SharedPtr< LogLevel > level)
 Writes the specified message and exception to appenders. More...
 
void Write (System::SharedPtr< System::Object > message)
 Writes the specified message to appenders. More...
 
void WriteIf (bool condition, System::String message)
 Writes the specified message to appenders if condition is true. More...
 
void WriteIf (bool condition, System::SharedPtr< System::Object > message)
 Writes the specified message to appenders if condition is true. More...
 
void WriteIf (bool condition, System::SharedPtr< System::Object > message, System::Exception exception)
 Writes the specified message and exception to appenders if condition is true. More...
 
void WriteIf (System::SharedPtr< LogLevel > condition, System::String message)
 Writes the specified message if the log level is enabled. More...
 
void WriteIf (System::SharedPtr< LogLevel > condition, System::String message, System::Exception exception)
 Writes the specified message and exception if the log level is enabled. More...
 
void Dispose () override
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Static Public Member Functions

static System::SharedPtr< Loggerget_Debug ()
 Gets the debug logger. More...
 

Friends

class Aspose::Email::Tools::Logging::LoggerManager
 

Detailed Description

Provides the logging functionality.

Constructor & Destructor Documentation

◆ Logger() [1/2]

Aspose::Email::Tools::Logging::Logger::Logger ( )

◆ Logger() [2/2]

Aspose::Email::Tools::Logging::Logger::Logger ( System::String  name,
System::SharedPtr< LogLevel severity,
const System::ArrayPtr< System::SharedPtr< IAppender >> &  appender 
)

Member Function Documentation

◆ Dispose()

void Aspose::Email::Tools::Logging::Logger::Dispose ( )
override

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ get_Appenders()

System::SharedPtr<AppenderCollection> Aspose::Email::Tools::Logging::Logger::get_Appenders ( ) const

Gets the appender list.

◆ get_Debug()

static System::SharedPtr<Logger> Aspose::Email::Tools::Logging::Logger::get_Debug ( )
static

Gets the debug logger.

◆ get_Name()

System::String Aspose::Email::Tools::Logging::Logger::get_Name ( ) const

Gets name.

◆ get_Severity()

System::SharedPtr<LogLevel> Aspose::Email::Tools::Logging::Logger::get_Severity ( ) const

Gets severity.

◆ IsEnabled()

bool Aspose::Email::Tools::Logging::Logger::IsEnabled ( System::SharedPtr< LogLevel level)

Determines if logging is enabled for the specified level.

Parameters
levellevel to be checked
Returns
true

if logging is enabled for the specified level, otherwise it returns false

.

◆ set_Appenders()

void Aspose::Email::Tools::Logging::Logger::set_Appenders ( System::SharedPtr< AppenderCollection value)

Sets the appender list.

◆ set_Severity()

void Aspose::Email::Tools::Logging::Logger::set_Severity ( System::SharedPtr< LogLevel value)

Sets severity.

◆ Write() [1/4]

void Aspose::Email::Tools::Logging::Logger::Write ( System::SharedPtr< System::Object >  message)

Writes the specified message to appenders.

Parameters
messageThe message to write.

◆ Write() [2/4]

void Aspose::Email::Tools::Logging::Logger::Write ( System::String  message)

Writes the specified message to appenders.

Parameters
messageThe message to write.

◆ Write() [3/4]

void Aspose::Email::Tools::Logging::Logger::Write ( System::String  message,
System::Exception  ex,
System::SharedPtr< LogLevel level 
)

Writes the specified message and exception to appenders.

Parameters
messageThe message to write.
exThe exception to write.
levelThe log level.

◆ Write() [4/4]

void Aspose::Email::Tools::Logging::Logger::Write ( System::String  message,
System::Exception  exception 
)

Writes the specified message and exception to appenders.

Parameters
messageThe message to write.
exceptionThe exception to write.

◆ WriteFormat()

void Aspose::Email::Tools::Logging::Logger::WriteFormat ( System::String  format,
const System::ArrayPtr< System::SharedPtr< System::Object >> &  arguments 
)

Writes the message with specified format to appenders.

Parameters
format
arguments

◆ WriteIf() [1/5]

void Aspose::Email::Tools::Logging::Logger::WriteIf ( bool  condition,
System::SharedPtr< System::Object >  message 
)

Writes the specified message to appenders if condition is true.

Parameters
conditionThe condition to test.
messageThe message to write.

◆ WriteIf() [2/5]

void Aspose::Email::Tools::Logging::Logger::WriteIf ( bool  condition,
System::SharedPtr< System::Object >  message,
System::Exception  exception 
)

Writes the specified message and exception to appenders if condition is true.

Parameters
conditionThe condition to test.
messageThe message to write.
exceptionThe exception to write.

◆ WriteIf() [3/5]

void Aspose::Email::Tools::Logging::Logger::WriteIf ( bool  condition,
System::String  message 
)

Writes the specified message to appenders if condition is true.

Parameters
conditionThe condition to test.
messageThe message to write.

◆ WriteIf() [4/5]

void Aspose::Email::Tools::Logging::Logger::WriteIf ( System::SharedPtr< LogLevel condition,
System::String  message 
)

Writes the specified message if the log level is enabled.

Parameters
conditionThe log level.
messageThe message to log.

◆ WriteIf() [5/5]

void Aspose::Email::Tools::Logging::Logger::WriteIf ( System::SharedPtr< LogLevel condition,
System::String  message,
System::Exception  exception 
)

Writes the specified message and exception if the log level is enabled.

Parameters
conditionThe log level.
messageThe message to log.
exceptionThe exception to log.

◆ WriteLine() [1/3]

void Aspose::Email::Tools::Logging::Logger::WriteLine ( )

Writes the empty line to appenders.

◆ WriteLine() [2/3]

void Aspose::Email::Tools::Logging::Logger::WriteLine ( System::SharedPtr< System::Object >  message)

Writes the specified message to appenders.

Parameters
messageThe message to write.

◆ WriteLine() [3/3]

void Aspose::Email::Tools::Logging::Logger::WriteLine ( System::String  message)

Writes the specified message to appenders.

Parameters
messageThe message to write.

Friends And Related Function Documentation

◆ Aspose::Email::Tools::Logging::LoggerManager