summaryrefslogtreecommitdiff
path: root/syslog_mock_test.go
blob: ba93c25bd6c044ef54c28b6cd50e6e41974bcbc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import "log"

type SyslogTestActions struct {
	savedLogs []string
}

func (s *SyslogTestActions) Connect() error {
	return nil
}

func (s *SyslogTestActions) Info(writeMe string) {
	log.Printf("FAKE SYSLOG LINE: %s\n", writeMe)
	s.savedLogs = append(s.savedLogs, writeMe)
}

func (s *SyslogTestActions) GetLogs() []string {
	return s.savedLogs
}

func connectFakeSyslog() *SyslogTestActions {
	return new(SyslogTestActions)
}