Releases: maddinat0r/samp-log
Releases · maddinat0r/samp-log
v0.5
Breaking changes
- parameter
level
in functionCreateLog
has been removed, as log levels are now handled by the log-core YAML config file - function
SetLogPluginLogLevel
has been removed, specify theplugins/log-plugin
logger settings in thelog-config.yml
config instead - function
SetLogLevel
has been removed, specify the related logger setting in thelog-config.yml
config instead
New features:
- log-core has been updated to v0.5, refer to the log-core release page for all features and changes
- added support for redirecting console output to a logger; add
logplugin_capture_serverlog 1
to yourserver.cfg
to enable this feature (refer to this on why you'd want to enable this feature) - added more format specifiers to
Log
:
specifier | description |
---|---|
s | string |
d/i | decimal number |
o | octal number |
x | hex number (lowercase) |
X | hex number (uppercase) |
b | binary number |
f | float |
F | float with uppercase "NAN" and "INF" |
e | float (exponential notation) |
E | float (exponential notation with uppercase "E") |
g | float (general format; combination of "f" and "e") |
G | float (general format, uppercase) |
- general improvements
v0.4
This release breaks compatibility to all older versions! This means you can't use this version with the MySQL plugin version R41-2 or lower!
log-plugin
- added log-plugin plugin log (lol): this plugin now logs its own errors, warnings and debug messages; you can set the log level through
native SetLogPluginLogLevel(E_LOGLEVEL:level);
(it's set to error and warning by default) - general improvements
log-core
- catch
SIGINT
instead ofSIGTERM
on Linux - general improvements
v0.3
log-core
This release breaks compatibility to all older versions! This means you can't use this version with the MySQL plugin version R41 or lower!
Breaking changes: renamed server configuration variable logplugin_debuginfo
to logcore_debuginfo
New feature: log lines now print a full call trace
v0.2.1
log-core: bug-fix: undefined behavior when reading empty server config file line
v0.2
log-core:
- new server configuration variable
logplugin_debuginfo
: if set to0
, all AMX debug functionality will be disabled (all debug retrieval functions will returnfalse
), even if the AMX file is compiled with debug symbols - complete interface redesign:
- compatibility with C
- noticeable performance improvements
- new init/exit functions
samplog_Init
andsamplog_Exit
: these have to be called inLoad()
andUnload()
respectively
- major crash handling improvements:
- guaranteed crash-safety
- compatibility with other crash handlers (like the crashdetect plugin)
NOTE: load the crashdetect plugin before any other plugin which uses the log-core to ensure compatibility - log-core now detects the console close event on Windows (when you press the red X in the upper right corner of the console window)
- in case of a crash log-core now creates a
log-core.log
file and logs that crash, e.g.:
[31/07/2016 13:44:23] [ERROR] exception 0XC0000005 (ACCESS_VIOLATION) from Unhandled Exception Handler catched; shutting log-core down
(crash on Windows due to a bug in another plugin)
- bug-fix: carriage return isn't stripped from read server.cfg file (thanks to @ziggi for his PR)
log-plugin:
- ensure compatibility between upcoming MySQL plugin release
- added new parameter
debuginfo
toCreateLog
, which controls printing debug info on a per-log basis - code-breaking change:
SetLogLevel
has noenable
parameter anymore, specify the whole log level like that:SetLogLevel(logger, ERROR | WARNING | INFO);
v0.1: initial release
Current natives:
native Logger:CreateLog(const name[], E_LOGLEVEL:level = INFO | WARNING | ERROR)
:
creates a logger with the specified name and sets the log levelnative DestroyLog(Logger:logger)
:
destroys the specified loggernative SetLogLevel(Logger:logger, E_LOGLEVEL:level, bool:enabled)
:
enables/disables the specified log level (only one log level)native bool:IsLogLevel(Logger:logger, E_LOGLEVEL:level)
:
returnstrue
if the specified log level is enabled,false
if not or if error occurednative Log(Logger:logger, E_LOGLEVEL:level, const msg[], {Float,_}:...)
:
logs the specified message with the specified logger
Note:- valid format specifiers are
%%
for an actual%
character,%i
/%d
for numbers,%f
for floats and%s
for strings - width and spacing is not supported
- valid format specifiers are