SA-MP Forums Archive
[Include] eLogs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] eLogs (/showthread.php?tid=658361)



eLogs - Effrey210 - 02.09.2018

Hi everyone!
I want to show You an innovative include that allows You to create logs.

Functions:

Creating Log:
Код:
CreateLog(id)
Writing in Log:
Код:
WriteLog(id, text)
Delete Log:
Код:
DeleteLog(id)
Sample usage:
Код:
stock PlayerAccountPath(playerid)
{
	new path[128];
	format(path, sizeof(path), FOLDER_ACCOUNT "%s.ini", PlayerName(playerid));
	return path;
}

CreateLog(PlayerAccountPath(playerid));
WriteLog(PlayerAccountPath(playerid), "Hello world!");
Download:
ZIPPYSHARE

Have a nice use.


Re: eLogs - RogueDrifter - 02.09.2018

Use pastebin/github to give us an easier view of the code.


Re: eLogs - Alteh - 03.09.2018

It would be nice if I could read logs too.


Re: eLogs - brauf - 03.09.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
Since I can't currently view the code (put it on github and make it a sampctl module please) I'll ask here - what about this makes it "innovative" over other log systems?



Re: eLogs - Exhibit - 03.09.2018

diNILogs


Re: eLogs - KinderClans - 03.09.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
Oh dear...

So the "innovations" I can see there are:

1) Using a 15 year old library (which wasn't even the best available at the time), instead of something good.
2) Inventing a new date format that isn't sorted, instead of using ISO 8601.
3) Using a library designed for updatable key/value pairs for linear data. Even using y_ini here would not be god because INI parsers have to check the entire file each time you write a value to see if that value already exists and replace it.
4) Stemming from (3) - the ability to write a maximum of one log entry per second and no more (because the INI system will replace the old one with the same time, because it isn't designed for log data).

Good innovations there...
THE FUTURE



Re: eLogs - Dayrion - 03.09.2018

And your example won't even works.


Re: eLogs - ShihabSoft - 03.09.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
Oh dear...

So the "innovations" I can see there are:

1) Using a 15 year old library (which wasn't even the best available at the time), instead of something good.
2) Inventing a new date format that isn't sorted, instead of using ISO 8601.
3) Using a library designed for updatable key/value pairs for linear data. Even using y_ini here would not be god because INI parsers have to check the entire file each time you write a value to see if that value already exists and replace it.
4) Stemming from (3) - the ability to write a maximum of one log entry per second and no more (because the INI system will replace the old one with the same time, because it isn't designed for log data).

Good innovations there...
What to say, **** these days?


Re: eLogs - BigETI - 03.09.2018

Logging using INI files, nice!


Re: eLogs - iLearner - 04.09.2018

yes y_log please.


Re: eLogs - Sew_Sumi - 04.09.2018

There was actually a thread I replied to months back about using an ini include to do logs. That's just messed up as heck.