egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

write log

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
urgido
Voice


Joined: 24 Jul 2008
Posts: 3

PostPosted: Sat Jul 26, 2008 1:30 am    Post subject: write log Reply with quote

which the command to force an eggdrop to write a log???
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Jul 26, 2008 11:07 am    Post subject: Reply with quote

putlog, putcmdlog, putxferlog, putloglev

doc/tcl-commands.doc wrote:
putlog <text>
Description: sends text to the bot's logfile, marked as 'misc' (o)
Returns: nothing
Module: core

putcmdlog <text>
Description: sends text to the bot's logfile, marked as 'command' (c)
Returns: nothing
Module: core

putxferlog <text>
Description: sends text to the bot's logfile, marked as 'file-area' (x)
Returns: nothing
Module: core

putloglev <level(s)> <channel> <text>
Description: sends text to the bot's logfile, tagged with all of the
valid levels given. Use "*" to indicate all log levels.
Returns: nothing
Module: core

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
urgido
Voice


Joined: 24 Jul 2008
Posts: 3

PostPosted: Sun Jul 27, 2008 3:15 pm    Post subject: Reply with quote

how i can create a .log file with this format:

BOTNAME-(dd-mm-yy).log

And then write on the file a line.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jul 27, 2008 6:49 pm    Post subject: Reply with quote

I'd do something like this:
Code:

set filename "/home/user/eggdrop/BOTNAME-[clock format [clock seconds] -format "%Y-%m-%d"].log"
set fID [open $filename "WRONLY CREAT APPEND"]
puts $fID "Some textline"
close $fID


Edit: Forgot to open the file in append-mode, fixed now
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber