[FilterScript] Logging
#6

Good, I like it but you have to improve it a lil bit.

1. Reduce string sizes. For example logData[400]; you dont need 400 characters in it, 160 is enough. 128 is maximum size they can enter + 11 characters for date + 10-20 max for cmd text, I doubt anyone will have a command thats bigger than 10-20 chars. Might not sound bad with a small server, but with a bigger one comes in handy.
Date for example can have maximum 10 characters in this case. Lets take highest date that can be
31/12/2016 < 10 chars + space after it (if any) = 11


2. Use switches. Some of the logs will be called constantly, so better save some speed. For example chatlog with 20-30 players online will be called every second atleast so better save some speed
PHP Code:
switch(SaveMode) {
    case 
1format(path,80,"Logs/%s/Commands.log",GetName(playerid));
    case 
2format(path,80,"Logs/%s.log",GetName(playerid));
    case 
3path "Logs/Log.log";
    case 
4path "Logs/Command.log";
    default return 
true//if none of them are selected add path here or just leave return true so it wont continue the code or call some unknown path

3. Use pastebin. Pastebin comes in handy significantly. Text file cannot be marked as a scripting or programming language therefore it can be hard to read + some of the indentification is fked up in text files
Reply


Messages In This Thread
Log Filterscript(Updated often) - by BiosMarcel - 21.01.2016, 09:41
Re: Logging - by Amunra - 21.01.2016, 10:18
Re: Logging - by BiosMarcel - 21.01.2016, 10:24
Re: Logging - by Jakwob - 22.01.2016, 20:53
Re: Logging - by MicroKyrr - 27.01.2016, 13:10
Re: Logging - by TwinkiDaBoss - 27.01.2016, 14:58
Re: Logging - by BiosMarcel - 27.01.2016, 15:00
Re: Logging - by TwinkiDaBoss - 27.01.2016, 15:02
Re: Logging - by TwinkiDaBoss - 27.01.2016, 15:07
Re: Logging - by BiosMarcel - 27.01.2016, 15:08
Re: Logging - by BiosMarcel - 27.01.2016, 18:53
Re: Logging - by MicroKyrr - 31.01.2016, 09:34
Re: Logging - by BiosMarcel - 31.01.2016, 09:49

Forum Jump:


Users browsing this thread: 1 Guest(s)