Remove a line from a .log file

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Remove a line from a .log file

Post by Staniak » Mon Apr 16, 2007 10:18 am

Hi guys,

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

dr_bliss
New User
Posts: 20
Joined: Mon Aug 07, 2006 2:02 am
Location: Poland -->Torun ->my room ->my computer

Post by dr_bliss » Mon Apr 16, 2007 11:02 am

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

Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Post by Staniak » Mon Apr 16, 2007 11:41 am

I want to edit a log file created by a custom package.

tartaros
New User
Posts: 28
Joined: Tue Mar 27, 2007 6:30 am
Contact:

Post by tartaros » Mon Apr 16, 2007 1:00 pm

wanna delete traces of a crime? : :lol: :lol:

Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Post by Staniak » Mon Apr 16, 2007 2:37 pm

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

User avatar
CWO
POL Expert
Posts: 1151
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO » Tue Apr 17, 2007 12:06 am

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.

Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Post by Staniak » Tue Apr 17, 2007 6:20 am

Hmm.. I guess that's just too much work for a little problem hehehe

Ok, thanks for all =]

User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am
Location: Illinois, USA

Post by Tritan » Tue Apr 17, 2007 9:35 am

If you want to add and remove information from a file use the Data File features. This will handle what you want to do.

User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey » Tue Apr 17, 2007 3:34 pm

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.

User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am
Location: Illinois, USA

Post by Tritan » Tue Apr 17, 2007 5:32 pm

OldnGrey wrote:Help systems arghhhh!
That is my feeling also. I have been avoiding writing a new help system for this very reason. 8)

Yukiko
Distro Developer
Posts: 2741
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko » Tue Apr 17, 2007 7:24 pm

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.

MuadDib
Former Developer
Posts: 1090
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Post by MuadDib » Tue Apr 17, 2007 8:39 pm

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? :)

Yukiko
Distro Developer
Posts: 2741
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko » Tue Apr 17, 2007 9:05 pm

That would be nice Maud.

User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am
Location: Illinois, USA

Post by Tritan » Wed Apr 18, 2007 3:36 am

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.

User avatar
CWO
POL Expert
Posts: 1151
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO » Wed Apr 18, 2007 6:12 am

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.

Post Reply