SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 05/08/2016, 06:47 PM   #11
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 884
Reputation: 435
Default Re: Log plugin

v0.2 has been released.
Changes:
  • log-core:
    • new server configuration variable 'logplugin_debuginfo': if set to '0', all AMX debug functionality will be disabled (all debug retrieval functions will return 'false'), 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' and 'samplog_Exit': these have to be called in 'Load()' and 'Unload()' 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.:
        Code:
        [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:
    • ensured compatibility between upcoming MySQL plugin release
    • added new parameter 'debuginfo' to 'CreateLog', which controls printing debug info on a per-log basis
    • code-breaking change: 'SetLogLevel' has no 'enable' parameter anymore, specify the whole log level like that:
      Code:
      SetLogLevel(logger, ERROR | WARNING | INFO);

Downloads are, as always, here: https://github.com/maddinat0r/samp-log/releases

Thanks for everyone's suggestions and bug reports!


EDIT: Sorry for not really answering to all the post above, but they did not go unnoticed. Many of these changes are based on the feedback everybody here provided, so thanks again!

EDIT 2: I've released a small update (v0.2.1) which addresses a bug in the log-core.

Last edited by maddinat0r; 06/08/2016 at 11:38 AM.
maddinat0r is offline   Reply With Quote
Old 03/09/2016, 06:38 PM   #12
Dayvison_
High-roller
 
Dayvison_'s Avatar
 
Join Date: Nov 2013
Posts: 1,183
Reputation: 166
Default Re: Log plugin

This plugin is awesome.

Maybe you can add a new parameter in CreateLog, to print the log result in console.
PHP Code:
native Logger:CreateLog(const name[], E_LOGLEVEL:level INFO WARNING ERRORbool:debuginfo truebool:printoutput false); 
Dayvison_ is online now   Reply With Quote
Old 05/09/2016, 07:32 PM   #13
zsoolt997
Little Clucker
 
Join Date: Aug 2015
Location: Hungary
Posts: 9
Reputation: 2
Default Re: Log plugin

I got this issue:

Code:
[20:25:45]  Loading plugin: log-plugin.so
[20:25:45]   Failed (/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by plugins/log-plugin.so))
I put everything to the right place and I still getting this error. What should I do?
zsoolt997 is offline   Reply With Quote
Old 06/09/2016, 07:52 AM   #14
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 884
Reputation: 435
Default Re: Log plugin

Quote:
Originally Posted by Day_ View Post
This plugin is awesome.

Maybe you can add a new parameter in CreateLog, to print the log result in console.
PHP Code:
native Logger:CreateLog(const name[], E_LOGLEVEL:level INFO WARNING ERRORbool:debuginfo truebool:printoutput false); 
Thanks!
I thought about adding a special console logger, which would be basically a "printf" with log levels. Having a whole logger additionally print its output to the console is an option too I guess. I could also add a new native "LogConsole" which does the same, only per-log-call instead of per-logger. I even could add a new option in the server.cfg to toggle printing all errors and/or warnings directly into the console. So yeah, I've got to think about what the best solution here is.

Quote:
Originally Posted by zsoolt997 View Post
I got this issue:

Code:
[20:25:45]  Loading plugin: log-plugin.so
[20:25:45]   Failed (/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by plugins/log-plugin.so))
I put everything to the right place and I still getting this error. What should I do?
Upgrade your Linux distribution. You're probably running CentOS 6, Ubuntu 12.04 or similarly old distributions. You'd have to upgrade at least to CentOS 7 or Ubuntu 14.04.
maddinat0r is offline   Reply With Quote
Old 09/09/2016, 12:58 PM   #15
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,602
Reputation: 187
Default Re: Log plugin

The plugin's awesome, so great job!

But I'm currently having an issue with the log-core.
When I use it with MapAndreas 1.2.1, I'm unable to shut the server down correctly.
It unloads all the plugins and freezes once it reaches MapAndreas.
(This happens when either log-plugin or mysql R40 are loaded)

This prints out in errors.log:
Quote:
[log-core] exception 0XC0000005 (ACCESS_VIOLATION) from Vectored Exception Handler catched; shutting log-core down
EDIT: I just read the reply you posted above (About v0.2), so it turns out it's a bug in MapAndreas. Will I have to contact the author of that plugin to fix that?
Stinged is offline   Reply With Quote
Old 09/09/2016, 02:28 PM   #16
Bruno_Cyra
Huge Clucker
 
Bruno_Cyra's Avatar
 
Join Date: Jan 2012
Posts: 230
Reputation: 12
Default Re: Log plugin

Thanks maddinat0r,

that's what I was searching for \o/
__________________
Quem sabe faz a hora, não espera acontecer.
Bruno_Cyra is offline   Reply With Quote
Old 10/09/2016, 01:43 PM   #17
venomlivno8
Big Clucker
 
Join Date: Jan 2013
Posts: 96
Reputation: 5
Default Re: Log plugin

One big, big, big problem is that it cannot be used with mysql, since mysql already has E_LOGLEVEL and, since you added #if !defined E_LOGLEVEL before defining it, it doesn't define and you can't use it.
venomlivno8 is offline   Reply With Quote
Old 10/09/2016, 02:08 PM   #18
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 884
Reputation: 435
Default Re: Log plugin

Quote:
Originally Posted by venomlivno8 View Post
One big, big, big problem is that it cannot be used with mysql, since mysql already has E_LOGLEVEL and, since you added #if !defined E_LOGLEVEL before defining it, it doesn't define and you can't use it.
The MySQL plugin, starting with R40, and this log plugin use the same log system underneath, the log core. Thus they both have the very same log levels, under the same enum, defined.
maddinat0r is offline   Reply With Quote
Old 10/09/2016, 10:43 PM   #19
KaisAggarwal
Little Clucker
 
KaisAggarwal's Avatar
 
Join Date: Aug 2016
Location: India,Chennai
Posts: 24
Reputation: 2
Default Re: Log plugin

Greatjob

Useful plugin
__________________

KaisAggarwal is offline   Reply With Quote
Old 14/09/2016, 05:48 PM   #20
JaydenJason
Gangsta
 
JaydenJason's Avatar
 
Join Date: Oct 2014
Location: teh netherlends
Posts: 715
Reputation: 51
Default Re: Log plugin

log-plugin.inc(26) : error 017: undefined symbol "INFO"
JaydenJason is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos7 - Streamer plugin and crashdetect plugin Su37Erich Server Support 3 12/08/2016 12:18 AM
[MySQL] From StickenKid's plugin to BlueG's plugin jessejanssen Scripting Help 2 15/06/2014 01:20 AM
Very good plugin suggestion (for scripters) and easy to make for the Plugin Developers! Xentiarox Plugin Development 5 29/07/2012 10:48 PM
[Question] Plugin Load Failed : Plugin Does not conform to architecture. Gamer_Z Plugin Development 2 09/06/2011 06:42 AM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 11:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.