aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Logging/Log.cpp
AgeCommit message (Collapse)Author
2015-08-21Core/Build: Merge common library and move database out of sharedStormBytePP
2015-08-16Fix build warnings addded in d5cf594bfe91ff22175c6e344b23b95cdbcc8a3cDDuarte
2015-08-16Core/Logging: Refactored appender creation to allow using logging without ↵Shauren
mysql dependency in tools (future task)
2015-07-22Core/Logging: Enable perfect forwarding for logging format and args.Naios
* Handle timestamp parsing though cppformat. * Change a wrong forward -> move
2015-03-18Merge pull request #14317 from Naios/typesafelogCarbenium
Type safe logging
2015-03-18Shared/Logs: Add support to .server set loglevel command after ↵jackpoz
003d67708b9a279da3d37e5ef06eb32ceab53964 Update the lowest log level when using ".server set loglevel" command. (cherry picked from commit 43f74fd8cfbab8f8fecf128e5d8d5d44ae767988)
2015-03-18Shared/Logs: Improve log performancesjackpoz
Improve Log::ShouldLog() performances by saving the lowest log level across all loggers and discarding any log with lower level than that. (cherry picked from commit 003d67708b9a279da3d37e5ef06eb32ceab53964)
2015-03-13Core/Log: Add type safe formattingNaios
* 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
2015-03-11Core/Log: Fix some issues detected by static analysis.Naios
* 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.
2015-01-01Update copyright note for 2015Vincent-Michael
Happy new year
2014-10-08Core/Logging: Replaced direct calls to GetCounter() in logs with ToString()Shauren
2014-07-21Core: Kill again whitespace :(Vincent-Michael
2014-07-08Replaced the LogWorker thread with Boost ASIOleak
2014-06-30Replaced ACE_Task_Base based LogWorker with ProducerConsumerQueueleak
2014-06-24Revert "Removed ACE dependencies from LogWorker" This actually needs way ↵leak
more work This reverts commit 0a592dd9dbd34818deee472dd42d700b4746a27e.
2014-06-24Removed ACE dependencies from LogWorkerleak
2014-06-23Merge branch 'master' of github.com:TrinityCore/TrinityCore into boostSubv
Conflicts: src/server/authserver/Server/AuthSession.cpp src/server/game/Server/WorldSession.h src/server/shared/Packets/ByteBuffer.cpp src/server/shared/Utilities/Util.h
2014-06-22Replaced all ACE_OS::localtime_r callsleak
2014-06-08Replaced dependencies on ace/OS_NS_time.hleak
2014-05-18Revert "Core/Logging: Use logger cache for speed up logger filter search"jackpoz
This reverts commit 39331ea7b9e906b67378a1be6c0c694d264eda3a. This is required to fix a race condition introduced with the logger cache. Adding a locking mechanism might make worthless the speed gain added by the cache itself, push a proper thread-safe implementation if it's worth it. Helgrind log: Possible data race during write of size 8 at 0x736F428 by thread #1 Locks held: none at 0x11872DF: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_bucket_begin(unsigned long, std::__detail::_Hash_node<std::pair<std::string const, Logger const*>, true>*) (hashtable.h:1196) by 0x11865A1: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<std::string const, Logger const*>, true>*) (hashtable.h:1342) by 0x1185A48: std::__detail::_Map_base<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::string const&) (hashtable_policy.h:496) by 0x1184F3A: std::unordered_map<std::string, Logger const*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, Logger const*> > >::operator[](std::string const&) (unordered_map.h:596) by 0x1184495: Log::GetLoggerByType(std::string const&) (Log.h:106) by 0x1184527: Log::ShouldLog(std::string const&, LogLevel) (Log.h:112) by 0x16E7121: World::LoadConfigSettings(bool) (World.cpp:909) by 0x16EB623: World::SetInitialWorldSettings() (World.cpp:1276) by 0x118F0EC: Master::Run() (Master.cpp:169) by 0x1196AFF: main (Main.cpp:142) This conflicts with a previous read of size 8 by thread #3 Locks held: none at 0x1186EA6: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_before_node(unsigned long, std::string const&, unsigned long) const (hashtable.h:1162) by 0x1186263: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_node(unsigned long, std::string const&, unsigned long) const (hashtable.h:604) by 0x11857B9: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(std::string const&) (hashtable.h:1025) by 0x1184DE2: std::unordered_map<std::string, Logger const*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, Logger const*> > >::find(std::string const&) (unordered_map.h:543) by 0x11842EF: Log::GetLoggerByType(std::string const&) (Log.h:84) by 0x1184527: Log::ShouldLog(std::string const&, LogLevel) (Log.h:112) by 0x189AACA: MySQLConnection::Execute(char const*) (MySQLConnection.cpp:175) by 0x18A3225: BasicStatementTask::Execute() (AdhocStatement.cpp:56) Address 0x736F428 is 120 bytes inside a block of size 184 alloc'd at 0x4C2AE3A: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:350) by 0x1185046: ACE_Singleton<Log, ACE_Thread_Mutex>::instance() (Singleton.cpp:91) by 0x11968E2: main (Main.cpp:135)
2014-05-18Revert "Core/Logging: store loggers in cache correctly"jackpoz
This reverts commit c6a4d5a1de1c8e9c7722a5a13695d1273b8cbfbc.
2014-04-08Core/Logging: store loggers in cache correctlyjoschiwald
2014-01-01Update copyright note for 2014.Vincent_Michael
Happy new year.
2013-12-19Core/Logging: Use logger cache for speed up logger filter searchSpp
2013-11-11Core/Logging: Minor changesSpp
- Select stderr when writing ERROR and FATAL messages - Simplify function defines - Fix `logs` table structure with latest logging changes
2013-11-08Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger ↵Spp
names are case-sensitive)
2013-11-08Core/Logs: Create default set of loggers and Appender if the config is wrong.Spp
- Logger root (Error) - Logger server (Info) - Appender Console Logger names are case-sensitive, Appender names are not.
2013-11-07Core/Logging: Extend logging system to allow inheritance of loggersSpp
- 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"
2013-09-07Core/Thread: Fix race condition converting time values to local timejackpoz
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)
2013-07-15Core/Config: Refactored ConfigMgrShauren
* Loading initial configuration files is now separate from loading any additional custom configs
2013-05-13Core/Logging: Performance-related tweaks to logging systemSpp
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros. Memleak fix
2013-02-21Core/Logging: Fix mem leak. Thanks to @Sar777 for the reportSpp
2013-01-24Core/Log: Fix console colors (missing change from 53a3373)Spp
Closes #9051
2013-01-24Core/Logging: Fix all possible crashes when using bad Appender config settingsSpp
2013-01-24Update src/server/shared/Logging/Log.cppspringfieldking
Fix crash when the last iter plus and change value
2013-01-23Core/Log: Allow configuring a maximum file size for a log file. If the file ↵Machiavelli
size is about to be exceeded, the core will create a new file titled <oldname>_.log and start outputting there.
2013-01-16Core/Logging: Add config option to enable/disable asyncronous logging ↵Spp
(disabled by default)
2013-01-16Core/Logging: Use correct realmId when logging to DBSpp
2013-01-14Core/Misc: Apply codestyle to multiple filesSpp
2013-01-01Update copyright note for 2013.Vincent_Michael
Happy new year.
2012-12-31Core: Fixed some level 4 warnings (msvc)Shauren
2012-11-27Core/Misc: Set mode 0644 for filesSpp
2012-10-22Core/Logging: Fix PlayerDump loggingSpp
2012-10-02Core/Utilities: Do not expose internal store structure in Tokens and rename ↵Spp
it to Tokenizer
2012-09-26Core/Logging: Fix crash when trying to log a message while config is being ↵Spp
reloaded Closes #7878
2012-09-10Core: Warning fixes (Also some -pedantic under game folder)Spp
2012-09-01Core/Logging: Delete player filename will now use guid_name format like old ↵Spp
log system. (was set to account_name by error)
2012-09-01Core/Logging: Fix delete player crash having logging player enabled.Spp
closes #7437
2012-08-30Core: Fix many "errors"/warnings and coding style (1)Nay
Extractors, worldserver, authserver, shared and collision affected Errors were found using Cppcheck, open-source static analysis tool
2012-08-27Core/Logging: Minor optimization in ShouldLogSpp