* improves safety and log speed through:
- variadic templates
- perfect forwarding
* fixes a newline in db logs
* improve performance of Appender::write by using std::ostringstream && std::move
* Either inefficient or wrong usage of string::find(). string::compare() will
be faster if string::find's result is compared with 0, because it will not scan the whole string.
If your intention is to check that there are no findings in the string,
you should compare with std::string::npos.
* C-style pointer casting detected. C++ offers four different kinds of casts as replacements:
static_cast, const_cast, dynamic_cast and reinterpret_cast.
- Changed default loggers and appenders
- '.' determines the relation between loggers ("type.subtype" inherits "type" logger setting if logger "type.subtype" is not defined)
- When core logs a message it search for the correct logger (root is the default one)
ie: a message logged with "type.subtype"
* Core will try to find a logger with name "type.subtype", if its not found then will search for "type", again if its not found it will return the default one "root"
Replace thread-unsafe localtime() http://www.cplusplus.com/reference/ctime/localtime/ with thread-safe portable ACE_OS::localtime_r() .
Helgrind log:
Possible data race during read of size 4 at 0x6F183C0 by thread #1
Locks held: none
at 0x14E72E3: World::InitDailyQuestResetTime() (World.cpp:2772)
by 0x14E3A01: World::SetInitialWorldSettings() (World.cpp:1790)
by 0x101122A: Master::Run() (Master.cpp:164)
by 0x101740C: main (Main.cpp:142)
This conflicts with a previous write of size 4 by thread #2
Locks held: none
at 0x6C2D3BA: __tzfile_compute (tzfile.c:797)
by 0x6C2D036: __tz_convert (tzset.c:627)
by 0x164146C: LogMessage::getTimeStr(long) (Appender.cpp:23)
by 0x1641550: LogMessage::getTimeStr() (Appender.cpp:31)
by 0x1641722: Appender::write(LogMessage&) (Appender.cpp:80)
by 0x1633FCE: Logger::write(LogMessage&) (Logger.cpp:83)
by 0x16433D8: LogOperation::call() (LogOperation.cpp:29)
by 0x16428A4: LogWorker::svc() (LogWorker.cpp:45)
- Restored old CharDump (LOG_FILTER_PLAYER_DUMP) but disabled by default.
- "%s" is now used to set dynamic file names, only used by GM commands and Player dump
Changed multiple lines to a simple format:
- Logger.name=Type,LogLevel,Flags,AppenderList
- Appender.name=Type,LogLevel,Flags,optional1,optional2
* Type = File: optional1 = File name, optiona2 = Mode
* Type = Console: optional1 = Colors
Created a default set of loggers and appenders.
- Root logger defaults to Error, that means you will see nothing on console by default (not even loading)
- You need to add the loggers to Loggers options if you want to enable them, otherwise Root logger will be used for all types
Restored outSQLDriver (LOG_FILTER_SQL_DRIVER), outSQLDev (LOG_FILTER_SQL_DEV), outArena (LOG_FILTER_ARENA) and outChar (LOG_FILTER_CHARACTER) functionality by creating new types (LOG_FILTER_CHARACTER is a rename of LOG_FILTER_DELETE.
Note: You need to update your config file... again (yeah sorry... trying to make it simpler)