EzLogger

ezlogger_macros.hpp File Reference


Detailed Description

ezlogger_macros.hpp defines default macros for ezlogger class.

Description

EzLogger is used through macros, which allows source code file name, line number, and function name to be automatically inserted into the logging.

Definition in file ezlogger_macros.hpp.

Go to the source code of this file.

Logging macros that implement in both debug and release version, and use default verbosity level

#define EZLOGGER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)
 A macro used to log 1, 2, or 3 arguments.
#define EZLOGGERSTREAM   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true)
 A macro use for logging with iostream type syntax.
#define EZLOGGERSTREAM2(alterante_stream)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true, &alterante_stream)
 A macro to use an alternate output stream.
#define EZLOGGERPRINT   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).cprint
 A macro use for logging with C-Style printf syntax.
#define EZLOGGERVARIFY(x)   assert(axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level).log_if_fails_verification((x), #x))
 A macro that logs failed verifications and asserts.
#define EZLOGGERVAR(x)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")), x
 An easy to use macro to log both variable name and value.
#define EZLOGGERMARKER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)("marker")
 The EZLOGGERMARKER macro is used as a maker for condition logic.
#define EZLOGGERFUNCTRACKER   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__)
 The EZLOGGERFUNCTRACKER macro is used to trace the entering and exiting of a function.
#define EZLOGGERDISPLAY_STACK   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).display_stack();
 The EZLOGGERDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.
#define EZLOGGER_PRG_MAIN_ARG(argc, argv)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).prg_main_arg(argc, argv)
 The EZLOGGER_PRG_MAIN_ARG macro is used to log the program's input parameters.

Verbosity level logging macros, which implement in both debug and release version

#define EZLOGGERVL(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 A macro used to log 1, 2, or 3 arguments.
#define EZLOGGERVLSTREAM(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true)
 A macro use for logging with iostream type syntax.
#define EZLOGGERVLSTREAM2(verbosity_level, alterante_stream)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true, &alterante_stream)
 A macro to use an alternate output stream.
#define EZLOGGERVLPRINT(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).cprint
 A macro use for logging with C-Style printf syntax.
#define EZLOGGERVLVARIFY(verbosity_level, x)   assert(axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).log_if_fails_verification((x), #x))
 A macro that logs failed verifications and asserts.
#define EZLOGGERVLVAR(verbosity_level, x)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")),x
 An easy to use macro to log both variable name and value.
#define EZLOGGERVLMARKER(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)("marker")
 The EZLOGGERVLMARKER macro is used as a maker for condition logic.
#define EZLOGGERVLFUNCTRACKER(verbosity_level)   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 The EZLOGGERVLFUNCTRACKER macro is used to trace the entering and exiting of a function.
#define EZLOGGERVLDISPLAY_STACK(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).display_stack();
 The EZLOGGERVLDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.
#define EZLOGGERVL_PRG_MAIN_ARG(verbosity_level, argc, argv)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).prg_main_arg(argc, argv)
 The EZLOGGERVL_PRG_MAIN_ARG macro is used to log the program's input parameters.

Logging macros that only implement in debug version, and use default verbosity level

#define EZDBGONLYLOGGER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)
 A macro used to log 1, 2, or 3 arguments.
#define EZDBGONLYLOGGERSTREAM   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true)
 A macro use for logging with iostream type syntax.
#define EZDBGONLYLOGGERSTREAM2(alterante_stream)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true, &alterante_stream)
 A macro to use an alternate output stream.
#define EZDBGONLYLOGGERPRINT   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).cprint
 A macro use for logging with C-Style printf syntax.
#define EZDBGONLYLOGGERVAR(x)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'"))
 An easy to use macro to log both variable name and value.
#define EZDBGONLYLOGGERMARKER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)("marker")
 The EZDBGONLYLOGGERMARKER macro is used as a maker for condition logic.
#define EZDBGONLYLOGGERFUNCTRACKER   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__)
 The EZDBGONLYLOGGERFUNCTRACKER macro is used to trace the entering and exiting of a function.
#define EZDBGONLYLOGGERDISPLAY_STACK   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).display_stack();
 The EZDBGONLYLOGGERDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.
#define EZDBGONLYLOGGER_PRG_MAIN_ARG(argc, argv)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).prg_main_arg(argc, argv)
 The EZDBGONLYLOGGER_PRG_MAIN_ARG macro is used to log the program's input parameters.

Verbosity level logging macros, which implement ONLY in debug version

#define EZDBGONLYLOGGERVL(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 A macro used to log 1, 2, or 3 arguments.
#define EZDBGONLYLOGGERVLSTREAM(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true)
 A macro use for logging with iostream type syntax.
#define EZDBGONLYLOGGERVLSTREAM2(verbosity_level, alterante_stream)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true, &alterante_stream)
 A macro to use an alternate output stream.
#define EZDBGONLYLOGGERVLPRINT(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).cprint
 A macro use for logging with C-Style printf syntax.
#define EZDBGONLYLOGGERVLVAR(verbosity_level, x)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")),x
 An easy to use macro to log both variable name and value.
#define EZDBGONLYLOGGERVLMARKER(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)("marker")
 The EZDBGONLYLOGGERVLMARKER macro is used as a maker for condition logic.
#define EZDBGONLYLOGGERVLFUNCTRACKER(verbosity_level)   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 The EZDBGONLYLOGGERVLFUNCTRACKER macro is used to trace the entering and exiting of a function.
#define EZDBGONLYLOGGERVLDISPLAY_STACK(verbosity_level)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).display_stack();
 The EZDBGONLYLOGGERVLDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.
#define EZDBGONLYLOGGERVL_PRG_MAIN_ARG(verbosity_level, argc, argv)   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).prg_main_arg(argc, argv)
 The EZDBGONLYLOGGERVL_PRG_MAIN_ARG macro is used to log the program's input parameters.

Defines

#define EZLOGGER_IMPLEMENT_DEBUGLOGGING
 This macro is defined if _DEBUG or _DEBUG_ is defined.
#define __FUNCTION__   ""
 The __FUNCTION_ macro is defined by some implementations.


Define Documentation

#define __FUNCTION__   ""
 

The __FUNCTION_ macro is defined by some implementations.

Description

The __FUNCTION_ is supported by some compilers like VC++ 7.x, 8.x and GNU 3.x, 4.x. Compilers that support this macro replace the macro with the function name calling the macro. By default, for compilers that do not support this macro, __FUNCTION__ is replaced with an empty string by EzLogger.

For non-supporting compilers, optionally, the developer could choose to define this macro to a common name used in functions to declare a local variable with the name of the function.
#define __FUNCTION__ function_name
#include "ezlogger.hpp"
void Myfunction()
{
   const char* function_name = "Myfunction";
}
If this approach is used, than all functions that call an EzLogger macro within that translation unit would have to declare the function_name variable. Moreover, this define would have to be included in each translation unit that requires this approach.

#define EZDBGONLYLOGGER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)
 

A macro used to log 1, 2, or 3 arguments.

Example Usage

EZDBGONLYLOGGER(MyStr);
EZDBGONLYLOGGER(a, b);
EZDBGONLYLOGGER(a, b, c);
The argument can be any type that stringstream can convert to a string.

Definition at line 406 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGER_PRG_MAIN_ARG argc,
argv   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).prg_main_arg(argc, argv)
 

The EZDBGONLYLOGGER_PRG_MAIN_ARG macro is used to log the program's input parameters.

Example Usage

int main(int argc, char**argv)
{
EZDBGONLYLOGGER_PRG_MAIN_ARG(argc, argv);

Definition at line 508 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERDISPLAY_STACK   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).display_stack();
 

The EZDBGONLYLOGGERDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.

Example Usage

void FunctFoo()
{
	EZLOGGERFUNCTRACKER;
	EZDBGONLYLOGGERDISPLAY_STACK;  //Display includes current function
}
Note:
EZDBGONLYLOGGERDISPLAY_STACK has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERDISPLAY_STACK, EZLOGGERVLDISPLAY_STACK, EZDBGONLYLOGGERDISPLAY_STACK, EZDBGONLYLOGGERVLDISPLAY_STACK

Definition at line 497 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERFUNCTRACKER   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__)
 

The EZDBGONLYLOGGERFUNCTRACKER macro is used to trace the entering and exiting of a function.

Example Usage

EZDBGONLYLOGGERFUNCTRACKER;
void FunctFoo()
{
	EZDBGONLYLOGGERFUNCTRACKER;
	//Function Foo code here....
}
Note:
EZDBGONLYLOGGERFUNCTRACKER has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERFUNCTRACKER, EZLOGGERVLFUNCTRACKER, EZDBGONLYLOGGERFUNCTRACKER, EZDBGONLYLOGGERVLFUNCTRACKER

Definition at line 479 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERMARKER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)("marker")
 

The EZDBGONLYLOGGERMARKER macro is used as a maker for condition logic.

Example Usage

EZDBGONLYLOGGERMARKER;
This macro takes not arguments, and it's main purpose is to log the source code path of an executable.

Definition at line 461 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERPRINT   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).cprint
 

A macro use for logging with C-Style printf syntax.

Example Usage

EZDBGONLYLOGGERPRINT("i = %i and somedata = %s", i, somedata.c_str());

Definition at line 436 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERSTREAM   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true)
 

A macro use for logging with iostream type syntax.

Example Usage

EZDBGONLYLOGGERSTREAM << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;

Definition at line 415 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERSTREAM2 alterante_stream   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true, &alterante_stream)
 

A macro to use an alternate output stream.

Example Usage

EZDBGONLYLOGGERSTREAM2(std::cout) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
Note:
EZDBGONLYLOGGERSTREAM2 has a fixed verbosity level logic, and it's implemented and called only on debug version.
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 427 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVAR  )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'"))
 

An easy to use macro to log both variable name and value.

Example Usage

EZDBGONLYLOGGERVAR(somevariable);
Only takes one argument, but it will work with the following syntax:
bool SomeConditionVar = true;
EZDBGONLYLOGGERVAR(SomeConditionVar == false);

Definition at line 450 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVL verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 

A macro used to log 1, 2, or 3 arguments.

Example Usage

EZDBGONLYLOGGERVL(axter::log_often)(MyStr);
EZDBGONLYLOGGERVL(axter::log_rarely)(a, b);
EZDBGONLYLOGGERVL(axter::log_very_rarely)(a, b, c);
The argument can be any type that stringstream can convert to a string.
See also:
EZLOGGER, EZLOGGERVL, EZDBGONLYLOGGER, EZDBGONLYLOGGERVL

Definition at line 529 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVL_PRG_MAIN_ARG verbosity_level,
argc,
argv   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).prg_main_arg(argc, argv)
 

The EZDBGONLYLOGGERVL_PRG_MAIN_ARG macro is used to log the program's input parameters.

Example Usage

int main(int argc, char**argv)
{
EZDBGONLYLOGGERVL_PRG_MAIN_ARG(axter::log_always, argc, argv);
See also:
EZLOGGER_PRG_MAIN_ARG, EZLOGGERVL_PRG_MAIN_ARG, EZDBGONLYLOGGER_PRG_MAIN_ARG, EZDBGONLYLOGGERVL_PRG_MAIN_ARG

Definition at line 627 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLDISPLAY_STACK verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).display_stack();
 

The EZDBGONLYLOGGERVLDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.

Example Usage

void FunctFoo()
{
	EZDBGONLYLOGGERVLFUNCTRACKER(axter::log_often);
	EZDBGONLYLOGGERVLDISPLAY_STACK(axter::log_often);  //Display includes current function
}
See also:
EZLOGGERDISPLAY_STACK, EZLOGGERVLDISPLAY_STACK, EZDBGONLYLOGGERDISPLAY_STACK, EZDBGONLYLOGGERVLDISPLAY_STACK

Definition at line 615 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLFUNCTRACKER verbosity_level   )     axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 

The EZDBGONLYLOGGERVLFUNCTRACKER macro is used to trace the entering and exiting of a function.

Example Usage

void FunctFoo()
{
	EZDBGONLYLOGGERVLFUNCTRACKER(axter::log_often);
	//Function Foo code here....
}
See also:
EZLOGGERFUNCTRACKER, EZLOGGERVLFUNCTRACKER, EZDBGONLYLOGGERFUNCTRACKER, EZDBGONLYLOGGERVLFUNCTRACKER

Definition at line 600 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLMARKER verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)("marker")
 

The EZDBGONLYLOGGERVLMARKER macro is used as a maker for condition logic.

Example Usage

EZDBGONLYLOGGERVLMARKER(axter::log_often);
This macro takes not arguments, and it's main purpose is to log the source code path of an executable.
See also:
EZLOGGERMARKER, EZLOGGERVLMARKER, EZDBGONLYLOGGERMARKER, EZDBGONLYLOGGERVLMARKER

Definition at line 586 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLPRINT verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).cprint
 

A macro use for logging with C-Style printf syntax.

Example Usage

EZDBGONLYLOGGERVLPRINT(axter::log_often)("i = %i and somedata = %s", i, somedata.c_str());
See also:
EZLOGGERPRINT, EZLOGGERVLPRINT, EZDBGONLYLOGGERPRINT, EZDBGONLYLOGGERVLPRINT

Definition at line 559 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLSTREAM verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true)
 

A macro use for logging with iostream type syntax.

Example Usage

EZDBGONLYLOGGERVLSTREAM(axter::log_rarely) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 539 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLSTREAM2 verbosity_level,
alterante_stream   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true, &alterante_stream)
 

A macro to use an alternate output stream.

Example Usage

EZDBGONLYLOGGERVLSTREAM2(axter::log_rarely, std::cerr) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 549 of file ezlogger_macros.hpp.

#define EZDBGONLYLOGGERVLVAR verbosity_level,
 )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")),x
 

An easy to use macro to log both variable name and value.

Example Usage

EZDBGONLYLOGGERVLVAR(axter::log_often, somevariable);
Only takes one argument, but it will work with the following syntax:
bool SomeConditionVar = true;
EZDBGONLYLOGGERVLVAR(axter::log_always, SomeConditionVar == false);
See also:
EZLOGGERVAR, EZLOGGERVLVAR, EZDBGONLYLOGGERVAR, EZDBGONLYLOGGERVLVAR

Definition at line 574 of file ezlogger_macros.hpp.

#define EZLOGGER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)
 

A macro used to log 1, 2, or 3 arguments.

Example Usage

EZLOGGER(MyStr);
EZLOGGER(a, b);
EZLOGGER(a, b, c);
The argument can be any type that stringstream can convert to a string.
Note:
EZLOGGER has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGER, EZLOGGERVL, EZDBGONLYLOGGER, EZDBGONLYLOGGERVL

Definition at line 74 of file ezlogger_macros.hpp.

#define EZLOGGER_IMPLEMENT_DEBUGLOGGING
 

This macro is defined if _DEBUG or _DEBUG_ is defined.

Note:
Optionally, EZLOGGER_IMPLEMENT_DEBUGLOGGING can be defined by the developer so-as implement debug-logging in release version.

Definition at line 20 of file ezlogger_macros.hpp.

#define EZLOGGER_PRG_MAIN_ARG argc,
argv   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).prg_main_arg(argc, argv)
 

The EZLOGGER_PRG_MAIN_ARG macro is used to log the program's input parameters.

Example Usage

int main(int argc, char**argv)
{
	EZLOGGER_PRG_MAIN_ARG(argc, argv);
Note:
EZLOGGER_PRG_MAIN_ARG has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGER_PRG_MAIN_ARG, EZLOGGERVL_PRG_MAIN_ARG, EZDBGONLYLOGGER_PRG_MAIN_ARG, EZDBGONLYLOGGERVL_PRG_MAIN_ARG

Definition at line 215 of file ezlogger_macros.hpp.

#define EZLOGGERDISPLAY_STACK   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).display_stack();
 

The EZLOGGERDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.

Example Usage

void FunctFoo()
{
	EZLOGGERFUNCTRACKER;
	EZLOGGERDISPLAY_STACK;  //Display includes current function
}
Note:
EZLOGGERDISPLAY_STACK has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERDISPLAY_STACK, EZLOGGERVLDISPLAY_STACK, EZDBGONLYLOGGERDISPLAY_STACK, EZDBGONLYLOGGERVLDISPLAY_STACK

Definition at line 200 of file ezlogger_macros.hpp.

#define EZLOGGERFUNCTRACKER   axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__)
 

The EZLOGGERFUNCTRACKER macro is used to trace the entering and exiting of a function.

Example Usage

void FunctFoo()
{
EZLOGGERFUNCTRACKER;
//Function Foo code here....
}
Note:
EZLOGGERFUNCTRACKER has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERFUNCTRACKER, EZLOGGERVLFUNCTRACKER, EZDBGONLYLOGGERFUNCTRACKER, EZDBGONLYLOGGERVLFUNCTRACKER

Definition at line 182 of file ezlogger_macros.hpp.

#define EZLOGGERMARKER   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)("marker")
 

The EZLOGGERMARKER macro is used as a maker for condition logic.

Example Usage

EZLOGGERMARKER;
This macro takes not arguments, and it's main purpose is to log the source code path of an executable.
Note:
EZLOGGERMARKER has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERMARKER, EZLOGGERVLMARKER, EZDBGONLYLOGGERMARKER, EZDBGONLYLOGGERVLMARKER

Definition at line 165 of file ezlogger_macros.hpp.

#define EZLOGGERPRINT   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__).cprint
 

A macro use for logging with C-Style printf syntax.

Example Usage

EZLOGGERPRINT("i = %i and somedata = %s", i, somedata.c_str());
Note:
EZLOGGERPRINT has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERPRINT, EZLOGGERVLPRINT, EZDBGONLYLOGGERPRINT, EZDBGONLYLOGGERVLPRINT

Definition at line 113 of file ezlogger_macros.hpp.

#define EZLOGGERSTREAM   axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true)
 

A macro use for logging with iostream type syntax.

Example Usage

EZLOGGERSTREAM << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
Note:
EZLOGGERSTREAM has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 87 of file ezlogger_macros.hpp.

#define EZLOGGERSTREAM2 alterante_stream   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level, true, &alterante_stream)
 

A macro to use an alternate output stream.

Example Usage

EZLOGGERSTREAM2(std::cout) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
Note:
EZLOGGERSTREAM2 has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 100 of file ezlogger_macros.hpp.

#define EZLOGGERVAR  )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")), x
 

An easy to use macro to log both variable name and value.

Example Usage

EZLOGGERVAR(somevariable);
Only takes one argument, but it will work with the following syntax:
bool SomeConditionVar = true;
EZLOGGERVAR(SomeConditionVar == false);
Note:
EZLOGGERVAR has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERVAR, EZLOGGERVLVAR, EZDBGONLYLOGGERVAR, EZDBGONLYLOGGERVLVAR

Definition at line 150 of file ezlogger_macros.hpp.

#define EZLOGGERVARIFY  )     assert(axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, axter::log_default_verbosity_level).log_if_fails_verification((x), #x))
 

A macro that logs failed verifications and asserts.

Example Usage

bool SomeConditionVar = true;
EZLOGGERVARIFY(SomeConditionVar == false);
In the debug version, an assertion is done on the results.
Note:
EZLOGGERVARIFY has a fixed verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERVARIFY, EZLOGGERVLVARIFY

Definition at line 129 of file ezlogger_macros.hpp.

#define EZLOGGERVL verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 

A macro used to log 1, 2, or 3 arguments.

Example Usage

EZLOGGERVL(axter::log_often)(MyStr);
EZLOGGERVL(axter::log_rarely)(a, b);
EZLOGGERVL(axter::log_very_rarely)(a, b, c);
The argument can be any type that stringstream can convert to a string.
Note:
EZLOGGERVL has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGER, EZLOGGERVL, EZDBGONLYLOGGER, EZDBGONLYLOGGERVL

Definition at line 238 of file ezlogger_macros.hpp.

#define EZLOGGERVL_PRG_MAIN_ARG verbosity_level,
argc,
argv   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).prg_main_arg(argc, argv)
 

The EZLOGGERVL_PRG_MAIN_ARG macro is used to log the program's input parameters.

Example Usage

int main(int argc, char**argv)
{
EZLOGGERVL_PRG_MAIN_ARG(axter::log_always, argc, argv);
Note:
EZLOGGERVL_PRG_MAIN_ARG has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGER_PRG_MAIN_ARG, EZLOGGERVL_PRG_MAIN_ARG, EZDBGONLYLOGGER_PRG_MAIN_ARG, EZDBGONLYLOGGERVL_PRG_MAIN_ARG

Definition at line 379 of file ezlogger_macros.hpp.

#define EZLOGGERVLDISPLAY_STACK verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).display_stack();
 

The EZLOGGERVLDISPLAY_STACK macro is use to display the current stack. Only functions that have used the EZLOGGERFUNCTRACKER or associated xxxxFUNCTRACKER macro are included in the stack.

Example Usage

void FunctFoo()
{
	EZLOGGERVLFUNCTRACKER(axter::log_often);
	EZLOGGERVLDISPLAY_STACK(axter::log_often);  //Display includes current function
}
Note:
EZLOGGERVLDISPLAY_STACK has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERDISPLAY_STACK, EZLOGGERVLDISPLAY_STACK, EZDBGONLYLOGGERDISPLAY_STACK, EZDBGONLYLOGGERVLDISPLAY_STACK

Definition at line 364 of file ezlogger_macros.hpp.

#define EZLOGGERVLFUNCTRACKER verbosity_level   )     axter::ezfunction_tracker my_function_tracker##__LINE__(__FILE__, __LINE__, __FUNCTION__, verbosity_level)
 

The EZLOGGERVLFUNCTRACKER macro is used to trace the entering and exiting of a function.

Example Usage

void FunctFoo()
{
    EZLOGGERVLFUNCTRACKER(axter::log_often);
	//Function Foo code here....
}
Note:
EZLOGGERVLFUNCTRACKER has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERFUNCTRACKER, EZLOGGERVLFUNCTRACKER, EZDBGONLYLOGGERFUNCTRACKER, EZDBGONLYLOGGERVLFUNCTRACKER

Definition at line 346 of file ezlogger_macros.hpp.

#define EZLOGGERVLMARKER verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)("marker")
 

The EZLOGGERVLMARKER macro is used as a maker for condition logic.

Example Usage

EZLOGGERVLMARKER(axter::log_often);
This macro takes not arguments, and it's main purpose is to log the source code path of an executable.
Note:
EZLOGGERVLMARKER has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERMARKER, EZLOGGERVLMARKER, EZDBGONLYLOGGERMARKER, EZDBGONLYLOGGERVLMARKER

Definition at line 329 of file ezlogger_macros.hpp.

#define EZLOGGERVLPRINT verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).cprint
 

A macro use for logging with C-Style printf syntax.

Example Usage

EZLOGGERVLPRINT(axter::log_often)("i = %i and somedata = %s", i, somedata.c_str());
Note:
EZLOGGERVLPRINT has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERPRINT, EZLOGGERVLPRINT, EZDBGONLYLOGGERPRINT, EZDBGONLYLOGGERVLPRINT

Definition at line 277 of file ezlogger_macros.hpp.

#define EZLOGGERVLSTREAM verbosity_level   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true)
 

A macro use for logging with iostream type syntax.

Example Usage

EZLOGGERVLSTREAM(axter::log_rarely) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
Note:
EZLOGGERVLSTREAM has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM

Definition at line 251 of file ezlogger_macros.hpp.

#define EZLOGGERVLSTREAM2 verbosity_level,
alterante_stream   )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level, true, &alterante_stream)
 

A macro to use an alternate output stream.

Example Usage

EZLOGGERVLSTREAM2(axter::log_rarely, std::cerr) << "This is data1 " << data1 << "This is data2 " << data2 << std::endl;
Note:
EZLOGGERVLSTREAM2 has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERSTREAM, EZLOGGERVLSTREAM, EZDBGONLYLOGGERSTREAM, EZDBGONLYLOGGERVLSTREAM2

Definition at line 264 of file ezlogger_macros.hpp.

#define EZLOGGERVLVAR verbosity_level,
 )     axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level)(axter::ezlogger<>::to_str(#x) + axter::ezlogger<>::to_str(" = '") + axter::ezlogger<>::to_str(x) + axter::ezlogger<>::to_str("'")),x
 

An easy to use macro to log both variable name and value.

Example Usage

EZLOGGERVLVAR(axter::log_often, somevariable);
Only takes one argument, but it will work with the following syntax:
bool SomeConditionVar = true;
EZLOGGERVLVAR(axter::log_always, SomeConditionVar == false);
Note:
EZLOGGERVLVAR has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERVAR, EZLOGGERVLVAR, EZDBGONLYLOGGERVAR, EZDBGONLYLOGGERVLVAR

Definition at line 314 of file ezlogger_macros.hpp.

#define EZLOGGERVLVARIFY verbosity_level,
 )     assert(axter::ezlogger<>(__FILE__, __LINE__, __FUNCTION__, verbosity_level).log_if_fails_verification((x), #x))
 

A macro that logs failed verifications and asserts.

Example Usage

bool SomeConditionVar = true;
EZLOGGERVLVARIFY(axter::log_always, SomeConditionVar == false);
In the debug version, an assertion is done on the results.
Note:
EZLOGGERVLVARIFY has verbosity level logic, and it's implemented and called on both debug and release version.
See also:
EZLOGGERVARIFY, EZLOGGERVLVARIFY

Definition at line 293 of file ezlogger_macros.hpp.


Generated on Wed Mar 29 00:31:09 2006 for EzLogger by  doxygen 1.4.6.Axter [Axter-Extended-Version]