Commit Graph

52 Commits

Author SHA1 Message Date
Spp
f0f97ab851 Core/Logging: Fix crash when trying to log a message while config is being reloaded
Closes #7878
2012-09-26 13:42:53 +02:00
Spp
358c6a26d6 Core: Warning fixes (Also some -pedantic under game folder) 2012-09-10 13:04:31 +02:00
Spp
7811e9100c Core/Logging: Delete player filename will now use guid_name format like old log system. (was set to account_name by error) 2012-09-01 21:18:01 +02:00
Spp
5cafe0ca01 Core/Logging: Fix delete player crash having logging player enabled.
closes #7437
2012-09-01 21:15:20 +02:00
Nay
5f1977cb1d Core: Fix many "errors"/warnings and coding style (1)
Extractors, worldserver, authserver, shared and collision affected

Errors were found using Cppcheck, open-source static analysis tool
2012-08-30 19:07:59 +01:00
Spp
5aee9433e1 Core/Logging: Minor optimization in ShouldLog 2012-08-27 12:56:45 +02:00
Spp
a566e3e58b Core/Logging: Move more log messages to LOG_FILTER_SERVER_LOADING 2012-08-16 11:02:46 +02:00
Nay
ca2bc35713 Misc: CRLF to LF, whitespace cleanup and tabs to spaces 2012-08-15 21:30:55 +01:00
Spp
52a5991c12 Core/Logging: Added documentation about this system
- 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
2012-08-15 19:58:02 +02:00
Spp
b77d88ec51 Core/Logging: Fix crash on authserver shutdown
Closes #7365
Closes #7325
2012-08-15 15:59:11 +02:00
Nay
429130522e Core/Authserver: Fix logging crash at startup 2012-08-07 04:21:58 +02:00
Spp
97c4b92eb0 Core/Logging: Try to simplify configuration of loggers and appenders
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)
2012-08-06 12:10:33 +02:00
Spp
5746b688fa Core/Logging: Reload Logging options when .reload config is used 2012-08-06 09:30:47 +02:00
Spp
3f42094b9c Core/Logging: Add option to remove timestamp, Log Level and Log Filter Type from logged msgs
- Appender config option .Timestamp and .Backup became obsolete
- New Appender config option .Flags added

Appender Console prefixes Log Level and Log Filter Type to the logged text as default
Appender File prefixes Timestamp, Log Level and Log Filter Type to the logged text as default
2012-08-05 15:38:25 +02:00
joschiwald
af92a36e88 Core/Logging: Use config LogsDir to save log files (re-added) 2012-08-04 02:55:11 +01: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
Gyx
5b7493fc66 Core/Misc: Code style and remove unused define.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-29 14:43:34 +08:00
leak
7309ee5621 SQL: Auth db data type cleanup logs, realmcharacters, realmlist, uptime / Storage engine switched to InnoDB Note:
As for the redundant `uptime`.`startstring` being removed, this page might be of interest how to generate time strings from unix timestamps
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
2012-03-28 19:46:38 +02:00
leak
8e3a4b956e Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table

Credits to TOM_RUS
2012-02-19 13:51:16 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
leak
73cf793e56 Core/DBLayer: Refactor prepared statement defines Note:
The new format for the middle section is a 3-letter upper case abbreviation of the sql command being executed (select -> SEL, update -> UPD, etc.)
{DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
2011-12-31 20:14:38 +01:00
leak
ef17c05dec Core/DBLayer: Convert PExecute() queries to prepared statements No. 1 2011-12-25 18:13:21 +01:00
Shauren
638693e78f Core: Fixed more warnings (C6246: Local declaration of 'x' hides declaration of the same name in outer scope.) 2011-11-23 17:55:16 +01:00
Spp
e3f8588a22 Minor changes here and there:
- Cosmetic changes
- 'Engrish fix'
- Initialization of some vars
- Remove some not needed includes
2011-10-18 14:59:23 +02:00
Spp
b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
Spp
be12603150 Configuration/ConfigMgr: converted from singleton to namespace with free functions. 2011-09-28 13:00:43 +02:00
Spp
7b68a6bf69 Core/Logging: Add new function to include full stacktrace.
Note: It only has use for devs but makes it easier to get the error with a full trace
2011-09-26 14:34:50 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Fredi Machado
bac261b001 Core/Log: Reload log levels and filters
on 'reload config' command
2011-09-08 23:00:26 -03:00
Spp-
e47b96af3e Core: Append single character to stream as character, not as a string 2011-07-29 14:18:28 +02:00
Spp-
e9aa72cc7b Cosmetic: rename function escape_string to EscapeString 2011-06-30 14:52:44 +02:00
Shocker
6a6e3e3265 Core/Logs: Add outSQLDev log, will be used for core-generated SQL queries/dumps 2011-06-29 16:31:01 +03:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
Machiavelli
e07e20ffca Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf. 2011-02-20 20:16:34 +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
click
67fade84d3 Core/Commands: Enable SQL query logging by config and command )patch by leak)
Closes issue 4853.

--HG--
branch : trunk
2010-11-19 13:13:07 +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
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
click
bf664b7a44 Cleanup/Core: Remove whitespace and tabs
--HG--
branch : trunk
2010-09-12 01:40:27 +02:00
Machiavelli
fd1c6c5440 Core/DBLayer: Add an assert in TransactionTask::Execute to make sure valid queries are held
Core/Logging: Tiny cleanup in sLog.outSQLDriver

--HG--
branch : trunk
2010-09-04 16:06:04 +02:00
Machiavelli
39027133e4 Fix Linux build
--HG--
branch : trunk
2010-09-03 00:04:14 +02:00
Machiavelli
175fece073 Core/Logging:
- Implement sLog.outSQLDriver that will log SQL driver related events (non-content related).
- Queries will now be logged into this file as well instead of normal log file (requires debug build).
- Don´t forget to update your authserver.conf and worldserver.conf
Core/build:
- Fix non-PCH build

--HG--
branch : trunk
2010-08-26 21:50:54 +02:00
click
5739c2efa9 Core: replace redirectional outStaticDebug with a copy of debug for future use and rewrite
--HG--
branch : trunk
2010-08-22 16:33:43 +02:00
click
670964803f Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG
--HG--
branch : trunk
2010-08-22 01:57:04 +02:00
Spp
c3343638cb Core: Remove lots warnings:
- All "'xxx' will be initialized after 'yyy' when initialized here"
- Some "unused variable"
- Some "enumeration value 'xxx' not handled in switch"

--HG--
branch : trunk
2010-08-21 20:08:47 +02:00
click
1f80c7b3c0 Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly
--HG--
branch : trunk
2010-08-08 19:45:53 +02:00
click
3296a944e7 Convert to using ACE for reading configurationfiles, and remove dependency on dotconfpp configuration library and related files
(patch by astellar - and a thankyou to vladimir for being a russian teddybear)

--HG--
branch : trunk
2010-07-29 01:22:45 +02:00
Machiavelli
0f7657b68c Get rid of Trinity Singleton and Threading patterns and replace them with ACE_Singletons and ACE_GUARD_x macro´s with ACE_Thread_Mutex´es respectively.
Also get rid of unused CountedReference class that used Trinity threading pattern.

--HG--
branch : trunk
2010-06-25 00:18:01 +02:00
Xanadu
c9b20170a3 Cleanup of logging - removed a few duplicit functions from olden times, fixed a typo.
--HG--
branch : trunk
2010-06-22 02:53:04 +02:00