summaryrefslogtreecommitdiff
path: root/lib/sbin/Logger.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-03 16:38:41 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-03 16:38:41 +0000
commit49cde4a53f86a3ffca3ec04560541b319fa2e8b5 (patch)
tree73ef0afc65888ba14efe820a586b2e492980a8bd /lib/sbin/Logger.pl
parent2a7b18f2bab26331de1fadfcabc35d95997f95c6 (diff)
Latest changes from Yaakoub.
Added true topological sorting of thorns. Proper error logging from configuration scripts. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3685 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/Logger.pl')
-rw-r--r--lib/sbin/Logger.pl46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/sbin/Logger.pl b/lib/sbin/Logger.pl
new file mode 100644
index 00000000..f81ac067
--- /dev/null
+++ b/lib/sbin/Logger.pl
@@ -0,0 +1,46 @@
+#! /usr/bin/perl -s
+#/*@@
+# @file Logger
+# @date Thu April 19 14:25:13 2004
+# @author Yaakoub El-Khamra
+# @desc
+# Logs configuration scripts
+# @enddesc
+# @version $Header$
+#@@*/
+
+
+require "$sbin_dir/CSTUtils.pl";
+
+#/*@@
+# @routine CreateLogFile
+# @date
+# @author Yaakoub El-Khamra
+# @desc
+# Writes logs of configuration scripts
+# @enddesc
+#@@*/
+sub CreateLogFile
+{
+ my($config_dir, $cfg, $thorns)=@_;
+ my($data) = '';
+
+ foreach $thorn (sort keys %thorns)
+ {
+ if ($cfg->{"\U$thorn\E PROVIDES"})
+ {
+ foreach $provides (split (' ', $cfg->{"\U$thorn\E PROVIDES"}))
+ {
+ $data .= "Configuration Script log for thorn: $thorn:\n";
+ $data .= $cfg->{"\U$thorn $provides\E MESSAGE"};
+ $data .= $cfg->{"\U$thorn $provides\E ERROR"};
+ }
+ }
+ }
+
+ &WriteFile("$config_dir/ConfigScripts.log", \$data);
+
+}
+
+
+1;