mIRC Home    About    Download    Register    News    Help

Print Thread
timestamping #129695 08/09/05 01:13 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
Hello all,

I would like to use a different timestamp in the logs than in the windows.

Is this possible in any way?

EDIT: I suppose it should be moved to scripting help because I relooked the options and couldn't find anything.

Last edited by LethPhaos; 08/09/05 02:30 PM.
Re: timestamping #129696 08/09/05 05:18 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
well i gues u could write your own logs or overwrite the normal logs whit our own format :tongue:

Re: timestamping #129697 09/09/05 12:51 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
i guess yes

any more specific hints or help?

Re: timestamping #129698 09/09/05 01:29 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If you really feel the need, you can disable logging and use a script to write the logs. You can then format things in whatever way you want. I'm guessing this will be more time consuming than using the built in logging, but I don't know for certain.

To write your own log files:
Code:
on *:text:*:*: {
  write $+($chan,.,$network,.,$date(yyyymmdd),.log) $+([,$time(hh:nntt),]) $+(<,$nick,>) $1-
}


You can easily change the $time format if you want. And, if you don't like that format for the filenames, you can change that as well.

Filename format is:
#channel.network.date.log
#Invision.IrcHighway.20050908.log

I'd recommend not logging all channels... this script will log all channels and queries and chats the way it is right now. You may want to limit it to just specific channels. That's up to you.


Invision Support
#Invision on irc.irchighway.net
Re: timestamping #129699 09/09/05 05:05 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
will an on text log everything? topics that change and actions, in fact everything, like real logging, should be logged.

will i have to add the same line with on action and on topic (if exists)?

Re: timestamping #129700 09/09/05 05:15 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, you'll need to use the same idea for all events you want logged.

The same basic type of format can be used for the events, with only a few changes depending on the format of the event.

Events to consider including:
Text
Action
Join
Part
Quit
Input
Nick
Notice (maybe)
Mode (this includes topic changes... just output the $1- and it should appear correctly)

Just change the write line so it looks the way you want. Basically, you need to change only this section of the write line: $+(<,$nick,>) $1-

The rest should stay the say for that line.

As an example, for actions, you'd change that part to:
* $nick $1-

(and perhaps add the color you use for actions).

As a final note... for the ON INPUT event, you need to manually do your own actions/nick changes/modes/etc because you won't trigger from the other events.

Example:
Code:
on *:input:*: {
  if ($1 == /me) { do the action output ... don't forget to use $me instead of $nick }
  elseif ($1 == /nick) { do the nick output }
  elseif ($1 == /mode) { do the mode output }
}



*****NOTE: I just realized that the format I used for the /write command will only work if you're logging a channel. Here's an updated way to do it:

Code:
on *:text:*:*: {
  if ($chan != $null) {
    write $+($chan,.,$network,.,$date(yyyymmdd),.log) $+([,$time(hh:nntt),]) $+(&lt;,$nick,&gt;) $1-
  }
  else {
    write $+($nick,.,$network,.,$date(yyyymmdd),.log) $+([,$time(hh:nntt),]) $+(&lt;,$nick,&gt;) $1-
  }
}


That will use the nick in the log's filename instead of the channel if the text is in a query/chat/fserv/etc window. Note that for the on input event, you can use the original method, by just replacing $chan with $target .

Last edited by Riamus2; 09/09/05 05:26 PM.

Invision Support
#Invision on irc.irchighway.net
Re: timestamping #129701 09/09/05 11:18 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Topic changes are not captured with on MODE afaik.

As for the on input script: /topic, /quit, /join, /part, /mode and /nick will have their normal events triggered even if you do the command, since the server sends those back. That leaves /msg, /me, /ame, /amsg, /describe and /echo and for those it seems best to make a custom alias that handles the logging.

alias say { say $1- | write $+($active,.,$network,.,$date(yyyymmdd),.log) $+([,$time(hh:nntt),]) $+(<,$nick,>) $1- }
alias msg { msg $1- | write $+($1,.,$network,.,$date(yyyymmdd),.log) $+([,$time(hh:nntt),]) $+(<,$me,>) $1- }
etc...

btw, the below line is valid, but handled incorrectly in your on INPUT script:
/// msg $me I sent this to myself!

The on INPUT is still needed though, but only for lines not starting with /:
Code:
on *:INPUT:*:{
  if ((/* iswm $1) &amp;&amp; (!$ctrlenter)) return
  say $1-
  halt
}

(Yes I should get the alternate command character too, I never found anyone actually using it))