// Write caches the passed message. Blocked by flush function.
Write caches the passed message. Blocked by flush function.
// Write caches the passed message . Blocked by flush function .
func (log *logCache) Write(message []byte) (int, error) {
	log.flushing.Lock()
	defer log.flushing.Unlock()
	if len(message) > 0 {
		messageCopy := make([]byte, len(message))
		copy(messageCopy, message)
		log.messages = append(log.messages, messageCopy)
	}
	return len(message), nil
}
func ( log * logCache ) Write ( message [ ] byte ) ( int , error ) { log . flushing . Lock ( ) defer log . flushing . Unlock ( ) if len ( message ) > 0 { messageCopy := make ( [ ] byte , len ( message ) ) copy ( messageCopy , message ) log . messages = append ( log . messages , messageCopy ) } return len ( message ) , nil }
Write caches the passed message.
Write caches the passed message .