Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP General Discussions Request for cleaner library logs in the console

 
  • 1 Vote(s) - 5 Average
Request for cleaner library logs in the console
Freaksken
Offline

open.mp Developer

Posts: 67
Threads: 4
Joined: Feb 2019
Reputation: 4
Location: Belgium
#1
2019-06-27, 05:32 AM (This post was last modified: 2021-01-05, 07:53 PM by Freaksken.)
Request for plugin/include developers to stop doing shit like this:
Code:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

gamemodetext = "Unknown"  (string)
password = ""  (string)
bind = ""  (string)
nosign = ""  (string)

Server Plugins
--------------
Loading plugin: mysql
>> plugin.mysql: R41-4 successfully loaded.
 Loaded.
Loading plugin: sscanf


===============================

     sscanf plugin loaded.    

        Version:  2.8.3        

 (c) 2018 Alex "Y_Less" Cole  

===============================

 Loaded.
Loading plugin: streamer


*** Streamer Plugin v2.9.4 by Incognito loaded ***

 Loaded.
Loading plugin: FCNPC

-------------------------------------------------
    FCNPC - Fully Controllable NPC v2.0.0
           Windows SA-MP 0.3.7 R2
          Jun 25 2019 at 00:12:08

 Author:       OrMisicL (2013 - 2015)
 Continued by: ziggi    (2016 - present)

 See full credits in the README.md file
-------------------------------------------------

Loading...

-------------------------------------------------
  ColAndreasv1.4.0

  Created By:
    [uL]Chris42O
    [uL]Slice
    [uL]Pottus
-------------------------------------------------

Loading...
ColAndreas v1.4.0 Loaded.
 Loaded.
Loading plugin: timerfix
 >> TimerFix v1.5 successfully loaded.
 Loaded.
Loading plugin: YSF
ARRAY_ConsoleCommands: 4e43d8


===============================

       YSF - kurta999's version R19 loaded

  (c) 2008 Alex "Y_Less" Cole - (c) 2010 - 2016 kurta999

   Server version: 0.3.7 R2-1

   Operating System: Windows

   Built on: Mar 11 2017 at 10:32:34

===============================

 Loaded.
Loaded 6 plugins.


Started server on port: 7777, with maxplayers: 50 lanmode is OFF.


Filterscripts
---------------
 Loading filterscript 'example.amx'...
Loaded collision data.
 Loaded 1 filterscripts.

[MySQL] Error: 2002 Can't connect to MySQL server on 'localhost' (10061).
Loading Map.
Loaded Map.
Number of vehicle models: 94

--- Server Shutting Down.
plugin.mysql: Unloading plugin...
plugin.mysql: Plugin unloaded.


===============================

    sscanf plugin unloaded.    

===============================



*** Streamer Plugin v2.9.4 by Incognito unloaded ***

FCNPC Unloaded.
[plugin.timerfix] Plugsin successfully unloaded!


==============

 YSF - kurta999's version R19 unloaded

==============

Example of what it could be, without all of this cluttering:
Code:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

Plugins
--------------
 Loading plugin: mysql
vR41-4
  Loaded.
 Loading plugin: sscanf
v2.8.3
  Loaded.
 Loading plugin: streamer
v2.9.4
  Loaded.
 Loading plugin: colandreas
v1.4.0
  Loaded.
 Loading plugin: FCNPC
v2.0.0
  Loaded.
 Loading plugin: timerfix
v1.5.0
  Loaded.
 Loading plugin: YSF
vR19
  Loaded.
 Loaded 7 plugins.

Filterscripts
---------------
 Loading filterscript: example
  Loaded.
 Loaded 1 filterscripts.

Gamemode
---------------
 Loading gamemode: bare
[MySQL] Error: 2002 Can't connect to MySQL server on 'localhost' (10061).
[ColAndreas] Info: Loading collision data.
[ColAndreas] Info: Loading Map.
  Loaded.

--- Server Shutting Down.
 Unloading gamemode: bare
  Unloaded.

 Unloading plugin: mysql
  Unloaded.
 Unloading plugin: sscanf
  Unloaded.
 Unloading plugin: streamer
  Unloaded.
 Unloading plugin: colandreas
  Unloaded.
 Unloading plugin: FCNPC
  Unloaded.
 Unloading plugin: timerfix
  Unloaded.
 Unloading plugin: YSF
  Unloaded.
 Unloaded 7 plugins.

Now ask yourself, which of these 2 examples would you like to consult, when for once you really really need to.

Some of this is clutter is baked into the server itself, but arguably those logs are somewhat useful. However, pretty much all of the logs done during plugin/include init and exit have no benefit, except for maybe the version number during init.
Why is this credits clutter so necessary? It's annoying and makes your logs actually less readable and useful. Imagine if every time you used a third party library in C and started your program, some credits shit about that library gets printed to the console. Sometimes those libraries are written by lots and lots of people. Now imagine not using just 1 third party library... For some reason this is just a thing that happens in this community. I'm guessing because 1 person did it in the early days and everyone else just followed.
So, I propose a few guidelines for readable, consistent and actually useful logs:
  1. On plugin/include init, only print the version number using the following format: v1.0.0
  2. On plugin/include exit, don't print anything.
  3. During the lifetime of the plugin/include, use one of these formats for different types of messages:
    • Info messages: [LIBRARY_NAME] Info: YOUR_MESSAGE.
    • Error messages: [LIBRARY_NAME] Error: YOUR_MESSAGE.
    • Warning messages: [LIBRARY_NAME] Warning: YOUR_MESSAGE.
  4. You can break rule 1 and 2 only if you're absolutely sure that what you need to log is very useful information and that you use the formats from rule 3.
What follows are examples for each rule, taken from the cleaned up code snippet above.

Rule 1:
Just the version number, preferably using semantic versioning.
Code:
v2.8.3

Rule 2:
Nothing, as mentioned.
Code:
 

Rule 3:
Info and error messages.
Code:
[ColAndreas] Info: Loading Map.
[MySQL] Error: 2002 Can't connect to MySQL server on 'localhost' (10061).

Rule 4:
Loading the ColAndreas collision data is useful information to know.
Code:
[ColAndreas] Info: Loading collision data.

I'm not asking for people not to be credited for their work. I'm asking to stop this stupid console cluttering.
Now, let's all start doing this and Make Logs Great Again!

Log and config files:
Adding to this, when a library has its own dedicated log file (e.g. mysql.log) it should go in the logs folder in the root of the server directory. Alternatively, if the library uses more than 1 log file, all those files should be together in a folder (e.g. logs/mysql). Configuration files (e.g. YSF.cfg) should go in the configs folder in the root of the server directory. Alternatively, if the library uses more than 1 config file, all those files should be together in a folder (e.g. configs/mysql).
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
Sasino97
Offline

Software Developer
Posts: 105
Threads: 15
Joined: Apr 2019
Reputation: 7
Location: Tampa, FL
#2
2019-07-03, 08:31 PM
I don't think there's anything wrong with reminding who's got the copyright of something, however I do agree with you on using standard version formats and the [PLUGIN_NAME] LOG_LEVEL: MESSAGE format.
[Image: Sasinosoft.png]
rasheed
Offline

Burgershot Member
Posts: 7
Threads: 1
Joined: Apr 2019
Reputation: 0
#3
2019-07-04, 07:26 PM
(2019-07-03, 08:31 PM)Sasino97 Wrote: I don't think there's anything wrong with reminding who's got the copyright of something, however I do agree with you on using standard version formats and the [PLUGIN_NAME] LOG_LEVEL: MESSAGE format.

It's just totally unnecessary becouse nobody will see except the owner.
Markski
Offline

Burgershot Clerk

Posts: 117
Threads: 6
Joined: Apr 2019
Reputation: 4
Location: La Plata, Argentina
#4
2019-07-04, 07:54 PM
Agreed, there's no use listing the credits of a plugin in logs. Those managing the server already know this stuff.

If you want so much exposure for your work, then start demanding server owners to list attributions, perhaps.
Visitano en la wed
Steam
Sauron
Offline

Burgershot Member
Posts: 7
Threads: 2
Joined: Jul 2019
Reputation: 0
Location: Preußen
#5
2019-07-06, 11:01 PM
If you don't like the format, then change it but I guess you should leave at least the credits for the peops.
I'd use that format if I'd be you:

Plugin: Alphabet
Ver.: -1.00
Credits.: Cool Boy
State.: (Loading/Loaded/Unloaded)
Southclaws
Offline

Administrator

Posts: 70
Threads: 13
Joined: Feb 2019
Reputation: 14
#6
2019-10-13, 08:29 AM (This post was last modified: 2019-10-13, 08:33 AM by Southclaws.)
Agree.

Credits belong in source, licenses, readmes, not in logs.

This is all you ever need:

Code:
open.mp v1.2.3

loading plugin: mysql:vR41-4
loading plugin: sscanf:v2.8.3
loading plugin: streamer:v2.9.4
loading plugin: colandreas:v1.4.0
loading plugin: FCNPC:v2.0.0
loading plugin: timerfix:v1.5.0
loading plugin: YSF:vR19
loading filterscripts: example
loading gamemode: bare

[MySQL] Error: 2002 Can't connect to MySQL server on 'localhost' (10061).
[ColAndreas] Info: Loading collision data.
[ColAndreas] Info: Loading Map.
[...]

unloading gamemode: bare
unloading filterscript example
unloading plugin: mysql:vR41-4
unloading plugin: sscanf:v2.8.3
unloading plugin: streamer:v2.9.4
unloading plugin: colandreas:v1.4.0
unloading plugin: FCNPC:v2.0.0
unloading plugin: timerfix:v1.5.0
unloading plugin: YSF:vR19
skilex
Offline

Burgershot Member
Posts: 1
Threads: 0
Joined: Oct 2019
Reputation: 0
Location: Poland
#7
2019-10-14, 05:29 PM
(2019-10-13, 08:29 AM)Southclaws Wrote: Agree.

Credits belong in source, licenses, readmes, not in logs.

This is all you ever need:

Code:
open.mp v1.2.3

loading plugin: mysql:vR41-4
loading plugin: sscanf:v2.8.3
loading plugin: streamer:v2.9.4
loading plugin: colandreas:v1.4.0
loading plugin: FCNPC:v2.0.0
loading plugin: timerfix:v1.5.0
loading plugin: YSF:vR19
loading filterscripts: example
loading gamemode: bare

[MySQL] Error: 2002 Can't connect to MySQL server on 'localhost' (10061).
[ColAndreas] Info: Loading collision data.
[ColAndreas] Info: Loading Map.
[...]

unloading gamemode: bare
unloading filterscript example
unloading plugin: mysql:vR41-4
unloading plugin: sscanf:v2.8.3
unloading plugin: streamer:v2.9.4
unloading plugin: colandreas:v1.4.0
unloading plugin: FCNPC:v2.0.0
unloading plugin: timerfix:v1.5.0
unloading plugin: YSF:vR19

You god!
Freaksken
Offline

open.mp Developer

Posts: 67
Threads: 4
Joined: Feb 2019
Reputation: 4
Location: Belgium
#8
2021-01-05, 07:50 PM (This post was last modified: 2021-01-05, 07:50 PM by Freaksken.)
Added small section on log and config files.
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode