Page 1 of 1

Remove a line from a .log file

Posted: Mon Apr 16, 2007 10:18 am
by Staniak
Hi guys,

Is there any way (function) to remove a line from a .log file?

Posted: Mon Apr 16, 2007 11:02 am
by dr_bliss
Which one *.log file do you have to edit?? Is it one of the autocreated logs at pol start-up (pol.log, start.log) ?? You can choose type of informations logged into pol.log by editing pol.cfg (like watchRMP, watchSysload).

If you try to remove line from log file created by custom package you need to edit one of scripts from this package :P.

You have to write something more what do you want... :P

Posted: Mon Apr 16, 2007 11:41 am
by Staniak
I want to edit a log file created by a custom package.

Posted: Mon Apr 16, 2007 1:00 pm
by tartaros
wanna delete traces of a crime? : :lol: :lol:

Posted: Mon Apr 16, 2007 2:37 pm
by Staniak
:lol:

I'm just testing some new help systems, and I was wondering if there's a way to do with log files... the only problem is that, i didn't find a way to remove written lines.

Posted: Tue Apr 17, 2007 12:06 am
by CWO
There is no way to remove a log line. The only way I can suggest although wasteful to POL especially if its a larger log file is to ReadFile(), look at every line in a foreach and remove the lines in the array that you don't want, then AppendToFile() the array.

Posted: Tue Apr 17, 2007 6:20 am
by Staniak
Hmm.. I guess that's just too much work for a little problem hehehe

Ok, thanks for all =]

Posted: Tue Apr 17, 2007 9:35 am
by Tritan
If you want to add and remove information from a file use the Data File features. This will handle what you want to do.

Posted: Tue Apr 17, 2007 3:34 pm
by OldnGrey
Help systems arghhhh! I took the easy way out.

I use the log files to record the GM pages, but I remove them manually once a GM has confirmed it has been solved. It made me ensure all pages were dealt with and that I saw each one myself. Log files don't need a world save to see them either.

On the other hand Data Files are good and editable in scripts, but they are alphanumerically sorted when saved, and the save order needs particular attention in your scripts otherwise you might get strings where you expected numbers etc.

Posted: Tue Apr 17, 2007 5:32 pm
by Tritan
OldnGrey wrote:Help systems arghhhh!
That is my feeling also. I have been avoiding writing a new help system for this very reason. 8)

Posted: Tue Apr 17, 2007 7:24 pm
by Yukiko
We don't track help pages but we do track things like createstack and attribute changes. Figured these were the most vulnerable areas for cheating. We use cfg files and like OnG delete them manually.

Posted: Tue Apr 17, 2007 8:39 pm
by MuadDib
Hrm. Coulda swore my old help system, complete with a volunteer help system for players, is written to use data files. Will have to dig it out and look it up now.

Is there one in distro? :)

Posted: Tue Apr 17, 2007 9:05 pm
by Yukiko
That would be nice Maud.

Posted: Wed Apr 18, 2007 3:36 am
by Tritan
The one I use currently makes use of data files. I just do not like the interface for it and I am not good with gumps so that is why it stays the way it is now.

Posted: Wed Apr 18, 2007 6:12 am
by CWO
I guess I'm behind on the times... mine still uses a global prop :-(

and ya... that was after I rewrote it for 096... I'm yet to get to it in my shard rewrite for 097.