| View previous topic :: View next topic |
| Author |
Message |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Nov 17, 2009 6:32 pm Post subject: How to write own lines in logfile ? |
|
|
Hello there,
I'm looking for a way to write, via tcl, lines in the channel log file. My bot receive datas from another one and I want to keep them in my logfile, from a procedure.
I can't use a log flag because I've to treat lines before store them, so any idea ?
Cheers _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Nov 17, 2009 7:44 pm Post subject: |
|
|
Have a look at the putloglev tcl command. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Nov 18, 2009 6:02 am Post subject: |
|
|
Oh, really strange bug with my script.
My eggdrop was well loging the channel, and I've added in one of my scripts:
| Code: | | putloglev p "$chan" "<$user> $text" |
And now, my eggdrop doesn't log anything, neither channel activity nor the script activity.
Before I changed the script, I've tried in party-line and it didn't make any trouble:
| PartyLine wrote: | | .tcl putloglev p "#test" "<CrazyCat> I'm testing" |
| Channel wrote: | | <CrazyCat> I'm testing too |
| test.log wrote: | [10:04] <CrazyCat> I'm testing
[10:05]<CrazyCat> I'm testing too |
And since I've rehash the eggdrop with the modified tcl, no more entries in my log file.
Any idea ? _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Dec 29, 2009 6:31 am Post subject: |
|
|
Hello, and sorry to up this thread, but I can't understand the trouble:
I've add a small procedure to do my puloglev:
| Code: | proc cr:log { lev chan line } {
putloglev $lev "$chan" "$line"
putlog "$line saved"
return 1
} |
This procedure is called at the end of others, and I can see the putlog in party-line, but nothing is added in the logfile, neither the "normal logged things", neither what I want to add in my logfile.
Does the putloglev modify the output destination ? Or am I wrong somewhere ? _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 29, 2009 7:13 pm Post subject: |
|
|
Sorry for the late reply.
To my best knowledge, using the putloglev command should not interfere with writing log files, as it never actually touches the files but merely add the message to the list of log entries to be written/displayed. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Dec 29, 2009 7:26 pm Post subject: |
|
|
http://www.eggheads.org/support/egghtml/1.6.19/tcl-commands.html#bindb
The problem is whatever is calling your "putlog" procedure is invoked by a bind. This isn't a problem, except when you aren't returning something to tcl. As instead, the return value will be the one returned from your "putlog" procedure as I assume it's at then very end of your pubm/msgm procedure, the last command before the procedure ends. For most wildcard binds, those that can use a * within them, a return value of 1 signifies do-not-log/take-no-further-action. You will need to investigate every "return" within your script especially those invoked through binds. Use the url above to check what return values signify to each bind.
Notice how pub and msg use a return of 1 to log. Whilst pubm and msgm do this when returned a 0. It's likely pubm/msgm bindings are your suspect. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Dec 30, 2009 4:00 am Post subject: |
|
|
I'd finally found my error (yes, a CKI one): I did rehash to try my changes, but it seems that the eggdrop needs a restart.
Now, it works well and I can log what I need.
@speechles: I've also modified the return 1 to return 0, I don't know if it's really important but it works  _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
|