Mercurial > hg > syntilista
changeset 159:d2905ee5ff9c
Add logging wrapper function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 18 Sep 2017 09:50:23 +0300 |
parents | f5c1861b48aa |
children | 1c2f9d09e87b |
files | slbackup.php |
diffstat | 1 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/slbackup.php Tue Sep 12 17:00:37 2017 +0300 +++ b/slbackup.php Mon Sep 18 09:50:23 2017 +0300 @@ -18,14 +18,6 @@ $dataBackups = 24; $configFile = "slbackup.cfg"; -if (file_exists($configFile)) - require_once $configFile; -else -{ - error_log("SyntilistaBackup: Configuration file '".$configFile."' does not exist!"); - exit; -} - // // Helper functions @@ -63,9 +55,24 @@ } +function stLog($msg) +{ + error_log("SyntilistaBackup: ".$msg); +} + + // // Actual main code begins here // +if (file_exists($configFile)) + require_once $configFile; +else +{ + stLog("Configuration file '".$configFile."' does not exist!"); + exit; +} + + $errorMsg = ""; $errorSet = FALSE; $index = "file"; @@ -73,7 +80,7 @@ if (!isset($dataSecret) || !isset($dataPath) || $dataSecret == "" || $dataPath == "") { - error_log("SyntilistaBackup: Invalid configuration."); + stLog("Invalid configuration."); exit; }