Page 3 of 3

Re: Simple Logger

Posted: Mon Nov 22, 2010 12:41 am
by syrik
How would I go about making one using screendump?

Re: Simple Logger

Posted: Tue Jun 21, 2016 7:42 am
by Proxy
Is there any way this logger could be used to catch echos sent by an alias or trigger?

Re: Simple Logger

Posted: Fri Jun 24, 2016 4:41 pm
by Belgarath
Code: [show] | [select all] lua
local oldecho = echo
function echo(str)
  oldecho(str)
  if Logger.trigger_id then
    Logger:Log(Logger.logging_file, str)
  end
end

Re: Simple Logger

Posted: Wed Jun 29, 2016 11:51 pm
by Proxy
Thank you so much, Belgarath! I have been trying to get that done for soo bloody long. Much appreciated!

Re: Simple Logger

Posted: Thu Jul 14, 2016 2:33 pm
by Proxy
I know I have been a pain in the ass, but is there any way that this logger could be used to append all logs to a single text file? In other words whenever you log in, that days log just gets added to the file and so on, leaving only one neat text file in you directory. I tried fiddling around with it but couldn't figure how to do it. Assuming the name of the file was "Test", how would I set this up, if at all possible?

Thank you all for your help

Re: Simple Logger

Posted: Fri Jul 15, 2016 10:46 pm
by SlySven
The normal "C" code way is to open the file in an "append" mode rather than a "create" mode - and given that Lua is built from C I suspect there is a way to tell it to open a fixed name file (rather than creating a new one each time based on the current day or whatever) in append mode.

RTFM as they say and, if it is the Lua io library that is being used, the bit of the M you ought to R is here... :P

Re: Simple Logger

Posted: Thu Jul 21, 2016 8:56 am
by Proxy
Thanks for the tip, SlySven! :)

Re: Simple Logger

Posted: Mon Apr 29, 2019 5:08 pm
by kitchen
This is neat an real helpful. Thanks for making the script!

Quick question: is there a way to make it so that it doesn't log the same thing twice. As in it will detect if there's a duplicate entry contained in the log and stop logging if the information is already contained in the log.

What I'm using it for is logging when I identify an item and don't need to have duplicate log entries if I identify the same item twice.