implements of log function More...
#include "stdafx.h"#include "LogFunctions.h"#include "FileFunctions.h"#include "StringFunctions.h"#include "CoreMacros.h"#include <map>#include <list>#include <utility>
Go to the source code of this file.
Functions | |
| void | setErrorCode (int code, const char *msg) |
| set error code and message More... | |
| void | setloglevel (int level) |
| set log level More... | |
| int | getloglevel () |
| get log level More... | |
| int | getlasterror () |
| get last error code More... | |
| const char * | getlasterrormessage () |
| get last error message More... | |
| void | outputlog (const char *msg, int level, const char *file, int line) |
| output log More... | |
| void | seterrorcode (int code, const char *msg) |
| set error code More... | |
| void | logfatal (const char *msg, const char *file, int line) |
| output fatal log More... | |
| void | logfatalcode (int code, const char *msg, const char *file, int line) |
| output fatal log and set error code More... | |
| void | logerror (const char *msg, const char *file, int line) |
| output error log More... | |
| void | logerrorcode (int code, const char *msg, const char *file, int line) |
| output error log and set error code More... | |
| void | logwarn (const char *msg, const char *file, int line) |
| output warning log More... | |
| void | logwarncode (int code, const char *msg, const char *file, int line) |
| output warning log and set error code More... | |
| void | loginfo (const char *msg, const char *file, int line) |
| output information log More... | |
| void | loginfocode (int code, const char *msg, const char *file, int line) |
| output information log and set error code More... | |
| void | logdebug (const char *msg, const char *file, int line) |
| output debug log More... | |
| void | logdebugcode (int code, const char *msg, const char *file, int line) |
| output debug log and set error code More... | |
| void | logtrace (const char *msg, const char *file, int line) |
| output trace log More... | |
| void | logtracecode (int code, const char *msg, const char *file, int line) |
| output trace log and set error code More... | |
| void | setloglistsize (const int size) |
| sets log list size More... | |
| int | getloglistsize () |
| gets log list size More... | |
| void | logflush () |
| flushes logs to be stored in the list | |
| void | setoutputlogfunction (void(*outputLogFun)(const char *, int)) |
| set output log function More... | |
Variables | |
| int | g_logLevel = LOG_LEVEL_WARN |
| void(* | g_outputLogFun )(const char *, int) = NULL |
| int | g_errorCode = 0 |
| int | g_logListSize = 0 |
| std::string | g_errorMessage |
| std::string | g_tmperrorMessage |
| std::list< std::pair< int, std::string > > | g_logList |
implements of log function
Copyright(C) 2006-2014 Eisai Co., Ltd. All rights reserved.
Definition in file LogFunctions.cpp.
| int getlasterror | ( | ) |
| const char * getlasterrormessage | ( | ) |
get last error message
Definition at line 95 of file LogFunctions.cpp.

| int getloglevel | ( | ) |
| int getloglistsize | ( | ) |
gets log list size
Definition at line 231 of file LogFunctions.cpp.
| void logdebug | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output debug log
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 198 of file LogFunctions.cpp.

| void logdebugcode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output debug log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 202 of file LogFunctions.cpp.

| void logerror | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output error log
| msg | log message |
| file | source file name |
| line | line number |
Definition at line 168 of file LogFunctions.cpp.

| void logerrorcode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output error log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 172 of file LogFunctions.cpp.

| void logfatal | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output fatal log
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 158 of file LogFunctions.cpp.

| void logfatalcode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output fatal log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 162 of file LogFunctions.cpp.

| void loginfo | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output information log
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 188 of file LogFunctions.cpp.

| void loginfocode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output information log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 192 of file LogFunctions.cpp.

| void logtrace | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output trace log
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 208 of file LogFunctions.cpp.

| void logtracecode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output trace log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 212 of file LogFunctions.cpp.

| void logwarn | ( | const char * | msg, |
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output warning log
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 178 of file LogFunctions.cpp.

| void logwarncode | ( | int | code, |
| const char * | msg, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output warning log and set error code
| [in] | code | error code |
| [in] | msg | log message |
| [in] | file | source file name |
| [in] | line | line number |
Definition at line 182 of file LogFunctions.cpp.

| void outputlog | ( | const char * | msg, |
| int | level, | ||
| const char * | file = NULL, |
||
| int | line = -1 |
||
| ) |
output log
| [in] | msg | log message |
| [in] | level | log level |
| [in] | file | file name |
| [in] | line | line number |
Definition at line 106 of file LogFunctions.cpp.

| void setErrorCode | ( | int | code, |
| const char * | msg | ||
| ) |
set error code and message
| code | error code |
| msg | error message |
Definition at line 65 of file LogFunctions.cpp.
| void seterrorcode | ( | int | code, |
| const char * | msg | ||
| ) |
set error code
| [in] | code | error code |
| [in] | msg | message |
Definition at line 146 of file LogFunctions.cpp.
| void setloglevel | ( | int | level | ) |
| void setloglistsize | ( | const int | size | ) |
sets log list size
| [in] | size | log list size (If size is negative, log list is unbounded.) |
Definition at line 218 of file LogFunctions.cpp.
| void setoutputlogfunction | ( | void(*)(const char *, int) | outputLogFun | ) |
set output log function
| [in] | outputLogFun | the pointer to output log function. Its arguments are log message (const char*) and log level (int) |
Definition at line 248 of file LogFunctions.cpp.
| int g_errorCode = 0 |
error code
Definition at line 33 of file LogFunctions.cpp.
| std::string g_errorMessage |
error message
Definition at line 39 of file LogFunctions.cpp.
| int g_logLevel = LOG_LEVEL_WARN |
log level
Definition at line 26 of file LogFunctions.cpp.
| std::list< std::pair< int, std::string > > g_logList |
log list
Definition at line 45 of file LogFunctions.cpp.
| int g_logListSize = 0 |
log list size
Definition at line 36 of file LogFunctions.cpp.
| void(* g_outputLogFun)(const char *, int) = NULL |
write log function
Definition at line 29 of file LogFunctions.cpp.
| std::string g_tmperrorMessage |
temporary error message
Definition at line 42 of file LogFunctions.cpp.
1.8.6