Skip to content
Snippets Groups Projects
Commit b3f01709 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

made the bindings not allow multiple calls of login

parent 82c07316
No related branches found
No related tags found
No related merge requests found
...@@ -96,3 +96,17 @@ func newRoundListUnregister(rounds []id.Round, ec []*dataStructures.EventCallbac ...@@ -96,3 +96,17 @@ func newRoundListUnregister(rounds []id.Round, ec []*dataStructures.EventCallbac
type ClientError interface { type ClientError interface {
Report(source, message, trace string) Report(source, message, trace string)
} }
type LogWriter interface{
Log(string)
}
type writerAdapter struct{
lw LogWriter
}
func (wa *writerAdapter)Write(p []byte) (n int, err error){
wa.lw.Log(string(p))
return len(p), nil
}
...@@ -137,6 +137,11 @@ func LogLevel(level int) error { ...@@ -137,6 +137,11 @@ func LogLevel(level int) error {
return nil return nil
} }
//RegisterLogWriter registers a callback on which logs are written.
func RegisterLogWriter(writer LogWriter){
jww.SetLogOutput(&writerAdapter{lw:writer})
}
//Unmarshals a marshaled contact object, returns an error if it fails //Unmarshals a marshaled contact object, returns an error if it fails
func UnmarshalContact(b []byte) (*Contact, error) { func UnmarshalContact(b []byte) (*Contact, error) {
c, err := contact.Unmarshal(b) c, err := contact.Unmarshal(b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment