Add debug to fucking links

This commit is contained in:
qowevisa 2024-06-08 22:05:28 +03:00
parent c5704f9d10
commit 2bd6b8546f

View File

@ -37,9 +37,20 @@ func (l *LinkCenter) AddLink(id uint16, link com.Link) error {
}
log.Printf("Added link by %s\n", string(link.Data))
l.Mu.Unlock()
l.debug()
return nil
}
func (l *LinkCenter) debug() {
for val, key := range l.Links {
if key == nil {
log.Printf("DEBUG: LINKCENTER: VAL = %s LINK = NIL\n", val)
continue
}
log.Printf("DEBUG: LINKCENTER: VAL = %s LINK = %v\n", val, *key)
}
}
func (l *LinkCenter) DeleteLink(data []byte) error {
l.Mu.Lock()
delete(l.Links, string(data))