Results 1 to 2 of 2

Thread: Realtime logging

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Realtime logging

    I was wondering what the best way to log to a html file would be.


    I.e. close off the html and body tag, but be able to reopen later


    Any ideas


    (I'd like to be able to still do it even after the program closes, and there may be a lot of logging to do, say for a mirc type app)


    THanks

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Well, if you never edit the log by hand then it's quite easy to ensure that the last line of the file is always
    </body></html>
    which is 14 characters. So, you open the file for appending, seek to 14 bytes before the end and just write, it will overwrite the end tags.

    Though I really recommend you log to XML and then use XSLT to transform to (X)HTML for display.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width