[Include] eLogs
#1

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.
Reply
#2

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

It would be nice if I could read logs too.
Reply
#4

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?
Reply
#5

diNILogs
Reply
#6

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
Reply
#7

And your example won't even works.
Reply
#8

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?
Reply
#9

Logging using INI files, nice!
Reply
#10

yes y_log please.
Reply
#11

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)