[LON-CAPA-cvs] cvs: loncom / LondConnection.pm

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 04 Nov 2003 11:11:08 -0000


foxr		Tue Nov  4 06:11:08 2003 EDT

  Modified files:              
    /loncom	LondConnection.pm 
  Log:
  Add function to set the module debug level.
  
  
Index: loncom/LondConnection.pm
diff -u loncom/LondConnection.pm:1.15 loncom/LondConnection.pm:1.16
--- loncom/LondConnection.pm:1.15	Tue Oct 28 06:15:10 2003
+++ loncom/LondConnection.pm	Tue Nov  4 06:11:08 2003
@@ -1,7 +1,7 @@
 #   This module defines and implements a class that represents
 #   a connection to a lond daemon.
 #
-# $Id: LondConnection.pm,v 1.15 2003/10/28 11:15:10 foxr Exp $
+# $Id: LondConnection.pm,v 1.16 2003/11/04 11:11:08 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,6 +46,13 @@
 my %perlvar;
 
 #
+#  Set debugging level
+#
+sub SetDebug {
+    $DebugLevel = shift;
+}
+
+#
 #   The config read is done in this way to support the read of
 #   the non-default configuration file in the
 #   event we are being used outside of loncapa.
@@ -176,6 +183,7 @@
     #  LoncapaHim fields of the object respectively.
     #
     if (!exists $hostshash{$Hostname}) {
+	&Debug(8, "No Such host $Hostname");
 	return undef;		# No such host!!!
     }
     my @ConfigLine = @{$hostshash{$Hostname}};
@@ -797,7 +805,7 @@
     my $Filename = shift;
     my %HostsTab;
     
-    open(CONFIG,'<'.$Filename) or die("Can't read $Filename");
+   open(CONFIG,'<'.$Filename) or die("Can't read $Filename");
     while (my $line = <CONFIG>) {
 	if (!($line =~ /^\s*\#/)) {
 	    my @items = split(/:/, $line);