--- motion-3.1.16.orig/event.c	Mon Jul 19 22:20:01 2004
+++ motion-3.1.16/event.c	Fri Oct  1 14:14:10 2004
@@ -36,7 +36,10 @@
 		execlp("sms_client", "sms_client", sms_nr, message, 0);
 		syslog(LOG_ERR, "Unable to send SMS message to number %s: %m", sms_nr);
 		exit(0);
+	} else {
+		syslog(LOG_DEBUG, "Sending SMS message to %s", sms_nr);
 	}
+
 }
 
 static void send_mail(char *mail_address, struct tm *currenttime)
@@ -45,7 +48,6 @@
 	int fdpipe[2];
 
 	if (!fork()) {
-		syslog(LOG_DEBUG, "Sending mail to %s", mail_address);
 		strftime(message, sizeof(message), 
 			"This is an automated message generated by motion\n\n"
 			"Motion detected: %Y-%m-%d %T\n\n", currenttime);
@@ -58,6 +60,8 @@
 		execlp("mail", "mail", mail_address, "-s", "MOTION ALERT", 0);
 		syslog(LOG_ERR, "Unable to send message to e-mail address %s: %m", mail_address);
 		exit(1);
+	} else {
+		syslog(LOG_DEBUG, "Sending mail to %s", mail_address);
 	}
 }
 
@@ -76,13 +80,13 @@
 #ifndef WITHOUT_V4L
 		vid_close();
 #endif /* WITHOUT_V4L */
-		syslog(LOG_DEBUG, "Executing external command '%s'\n", stamp);
 		execl("/bin/sh", "sh", "-c", stamp, " &", 0);
 		syslog(LOG_ERR, "Unable to start external command '%s' with parameters '%s': %m", stamp, arg);
 		exit(1);
+	} else {
+	   syslog(LOG_DEBUG, "Executing external command '%s'\n", stamp);
 	}
 }
-
 
 /* 
  *	Event handlers
