| … | |
… | |
| 80 | } else { |
80 | } else { |
| 81 | warn "failed to open $logFile for writing: $!"; |
81 | warn "failed to open $logFile for writing: $!"; |
| 82 | } |
82 | } |
| 83 | } |
83 | } |
| 84 | |
84 | |
|
|
85 | # $ce - a WeBWork::CourseEnvironment object |
|
|
86 | # $function - fully qualified function name |
|
|
87 | # $details - any information, do not use the characters '[' or ']' |
|
|
88 | # $beginEnd - the string "begin" or "end" |
|
|
89 | # use an empty string for $details when calling for END |
| 85 | sub writeTimingLogEntry($$$$) { |
90 | sub writeTimingLogEntry($$$$) { |
| 86 | my ($ce, $function, $details, $beginEnd) = @_; |
91 | my ($ce, $function, $details, $beginEnd) = @_; |
| 87 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
92 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
| 88 | $beginEnd = ($beginEnd eq "begin") ? ">" : "<"; |
93 | $beginEnd = ($beginEnd eq "begin") ? ">" : "<"; |
| 89 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |
94 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |