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 »

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 »

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 »

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 »

wanna delete traces of a crime? : :lol: :lol:
Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Post 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.
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post 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.
Staniak
New User
Posts: 9
Joined: Sun Feb 05, 2006 12:53 pm

Post by Staniak »

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 »

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 »

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 »

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: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post 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.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Post 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? :)
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko »

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 »

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: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

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