Example #1
0
func New(s ShowType) *ColorConsole {
	c := &ColorConsole{
		ty: s,
	}
	c.BaseListener = listener.NewBaseListener(c)
	return c
}
Example #2
0
File: file.go Project: nzlov/glog
func New(name string) (*File, error) {
	f := &File{
		name: name,
	}
	var err error
	f.f, err = os.Create(name)
	if err != nil {
		return nil, err
	}
	f.BaseListener = listener.NewBaseListener(f)
	return f, nil
}
Example #3
0
File: udp.go Project: nzlov/glog
func New(host string) (*Udp, error) {
	addr, err := net.ResolveUDPAddr("udp4", host)
	if err != nil {
		return nil, err
	}
	udp, err := net.DialUDP("udp4", nil, addr)
	if err != nil {
		return nil, err
	}
	u := &Udp{
		host: host,
		udp:  udp,
	}
	u.BaseListener = listener.NewBaseListener(u)
	return u, nil
}
Example #4
0
func New() *Console {
	c := &Console{}
	c.BaseListener = listener.NewBaseListener(c)
	return c
}