Example #1
0
func Test(err os.Error, mesg string) {
	if err != nil {
		syslog, _ := syslog.New(syslog.LOG_ERR, "echo server")
		_, err = io.WriteString(syslog, mesg)
		os.Exit(-1)
	}
}
Example #2
0
func SetLogName(name string) {
	if nil != logWriter {
		logWriter.Close()
		logWriter = nil
	}
	var err os.Error
	logWriter, err = syslog.New(syslog.LOG_DEBUG, name)
	MightFail(err, "Couldn't reopen syslog")
}
Example #3
0
package orchestra

import (
	"fmt"
	"net"
	"os"
	"runtime/debug"
	"syslog"
)

const (
	DefaultMasterPort = 2258
	DefaultHTTPPort   = 2259
)

var logWriter, _ = syslog.New(syslog.LOG_DEBUG, "orchestra")

func SetLogName(name string) {
	if nil != logWriter {
		logWriter.Close()
		logWriter = nil
	}
	var err os.Error
	logWriter, err = syslog.New(syslog.LOG_DEBUG, name)
	MightFail(err, "Couldn't reopen syslog")
}

func Debug(format string, args ...interface{}) {
	logWriter.Debug(fmt.Sprintf(format, args...))
}