Added custom field type support to Form
[tcl-tlc.git] / scripts / filelog.itcl
blob86736b87ce2f6fbc10129376126e271822fb0b1d
1 # vim: foldmarker=<<<,>>>
3 class tlc::Filelog {
4 inherit tlc::Log
6 constructor {args} {}
7 destructor {}
9 public {
10 variable filename
13 protected {
14 method output {level msg}
17 private {
18 variable fp
23 configbody tlc::Filelog::filename { #<<<1
24 if {[info exists fp]} {
25 catch {close $fp}
26 unset fp
29 set fp [open $filename a]
34 body tlc::Filelog::constructor {args} { #<<<1
35 eval configure $args
37 if {![info exists filename]} {
38 error "Must specify -filename"
43 body tlc::Filelog::destructor {} { #<<<1
44 if {[info exists fp]} {
45 close $fp
50 body tlc::Filelog::output {level msg} { #<<<1
51 if {$level >= $threshold} {
52 puts $fp "[clock format [clock seconds] -format {%d/%m/%Y %T}] $level $msg"
53 flush $fp