func NewMemoryBackend(size int) *MemoryBackend {
	return &MemoryBackend{maxSize: int32(size)}
}
NewMemoryBackend creates a simple in-memory logging backend.
package logging
import (
	"sync"
	"sync/atomic"
	"time"
	"unsafe"
)
func InitForTesting(level Level) *MemoryBackend {
	Reset()
	memoryBackend := NewMemoryBackend(10240)
	leveledBackend := AddModuleLevel(memoryBackend)
	leveledBackend.SetLevel(level, "")
	SetBackend(leveledBackend)
	timeNow = func() time.Time {
		return time.Unix(0, 0).UTC()
	}
	return memoryBackend
}
type node struct {
	next   *node
	Record *Record
}
func (n *node) Next() *node {
	return n.next
}
type MemoryBackend struct {
	size       int32
	maxSize    int32
	head, tail unsafe.Pointer
}