Rod Hynes 11 лет назад
Родитель
Сommit
5dd08654f1
1 измененных файлов с 46 добавлено и 0 удалено
  1. 46 0
      psiphon/notice.go

+ 46 - 0
psiphon/notice.go

@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Psiphon Inc.
+ * All rights reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package psiphon
+
+import (
+	"fmt"
+	"log"
+)
+
+const (
+	NOTICE_INFO            = "INFO"
+	NOTICE_ALERT           = "ALERT"
+	NOTICE_VERSION         = "VERSION"
+	NOTICE_TUNNEL          = "TUNNEL"
+	NOTICE_SOCKS_PROXY     = "SOCKS-PROXY"
+	NOTICE_HTTP_PROXY      = "HTTP-PROXY"
+	NOTICE_UPGRADE         = "UPGRADE"
+	NOTICE_HOMEPAGE        = "HOMEPAGE"
+	NOTICE_PAGE_VIEW_REGEX = "PAGE-VIEW-REGEX"
+	NOTICE_HTTPS_REGEX     = "HTTPS-REGEX"
+)
+
+func Notice(prefix, format string, args ...interface{}) {
+	log.Printf("%s %s", prefix, fmt.Sprintf(format, args...))
+}
+
+func Fatal(format string, args ...interface{}) {
+	log.Printf("FATAL %s", fmt.Sprintf(format, args...))
+}