Commit Graph

28 Commits

Author SHA1 Message Date
Spp
ebd14b4f01 Core/Mysql: Multiple changes
- added support for setting NULL column values to MySQL wrapper in core
- replaced nonstandard strdup function and manual memory management with std::string
- fixed bug in MySQLPreparedStatement::getQueryString method, it failed when string parameter contained embedded '?' symbols
- fixed memory leak in MySQLPreparedStatement::setString method
2013-01-02 12:22:50 +01:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Shauren
f1170ba0fb Core: Fixed some level 4 warnings (msvc) 2012-12-31 20:43:14 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Shauren
43cbb1e105 Core/DBLayer: Fixed memory leaks when query returned empty result set 2012-08-26 21:24:15 +02:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Shauren
c8d20004a5 Core: Minor code style corrections 2012-06-30 16:07:09 +02:00
Shauren
68fdf2a12f Core/DBLayer: Added missing prepared statement implementation for uint8/16 2012-03-31 14:16:48 +02:00
click
cbcd4e6afb Core: Fix .pinfo handling of player level and securitylevel after recent cleanups (and clean up my last commit) 2012-03-24 22:59:23 +01:00
click
eb3305932c Core/DB layer: Change functionality in previous memoryleak-fix (Patch by raczman) 2012-03-24 22:34:33 +01:00
Machiavelli
0eb3ffca41 Core/DB Layer: Fix a memory leak. Author: raczman (yes, you read correctly) 2012-03-24 19:24:36 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Spp-
e47b96af3e Core: Append single character to stream as character, not as a string 2011-07-29 14:18:28 +02:00
click
b6cf587de9 Core: Remove some warnings here and there 2011-05-13 18:07:12 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak
57f85ab7da Core/DBLayer: Replace prepared statement arrays with a map to avoid asynchronous indexes at query logging or error output
- Add values to prepared statement query log messages
- Killed a bit Engrish and trailing white whitespaces
2011-01-26 00:41:55 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
Shauren
928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
Machiavelli
76e111fa07 Core/DBLayer: Allow asynchronous queries with callbacks to be executed in prepared statement format as well.
+ Cleanup and documentation

--HG--
branch : trunk
2010-12-23 16:05:43 +01:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
df66aee929 Yet more copyright header updates
--HG--
branch : trunk
2010-10-07 13:38:35 +02:00
Machiavelli
019103cb5a Core/DBLayer: Correct size for storing MYSQL_TYPE_FLOAT
--HG--
branch : trunk
2010-09-19 15:28:35 +02:00
Machiavelli
22571e9443 Core/DBLayer:
- Allow storing floats in prepared statements explicitly (previously would be casted to double)
- Add GetBool ¨wrapper/hack¨ to PreparedResultset class.

--HG--
branch : trunk
2010-09-19 15:25:50 +02:00
Machiavelli
88f378e7ae Core/DBLayer: Fix a memory leak in prepared statement parameter/result binds. Original author: raczman
--HG--
branch : trunk
2010-09-13 17:07:27 +02:00
Machiavelli
d54225189e Core/DBLayer: Fix a warning
--HG--
branch : trunk
2010-09-06 17:55:12 +02:00
Spp
cdef980af4 Core: Fix some warnings
--HG--
branch : trunk
2010-09-06 15:23:08 +02:00
runningnak3d
7433768a55 Core/Build: Partial work of fixing non-PCH Linux compile
--HG--
branch : trunk
2010-09-02 17:19:53 -06:00
Machiavelli
1198591bac Core/DBLayer:
- Add basic prepared statement interface (without implementation and thus without testing, without resultset support).
- Based on raczman/Albator´s work on TrinityCore3

Build:
- Add sLog define ¨hack¨ in DatbaseWorkerPool.h to fix some more sLog errors temporarily

FYI: Builds on windows

--HG--
branch : trunk
2010-09-02 20:54:43 +02:00