func (l *Logs) Subscribe(uuid string) (
	chan []byte, chan []byte, error,
) {
	logChan, err := l.GetChannel(uuid)
	if err != nil {
		return nil, nil, err
	}
	schan, echan := messaging.CreateSubscriptionChannels()
	l.nub.Subscribe(logChan, "", schan, false, echan)
	return schan, echan, nil
}
Subscribe subscribe to device logs
package resingo
import (
	"errors"
	"fmt"
	"io"
	"github.com/antonholmquist/jason"
	"github.com/pubnub/go/messaging"
)
type Logs struct {
	nub     *messaging.Pubnub
	channel string
	ctx     *Context
	stop    chan struct{}
}
func NewLogs(ctx *Context) (*Logs, error) {
	cfg, err := ConfigGetAll(ctx)
	if err != nil {
		return nil, err
	}
	if cfg.PubNub.PubKey != "" && cfg.PubNub.SubKey != "" {
		n := messaging.NewPubnub(
			cfg.PubNub.PubKey,
			cfg.PubNub.SubKey, "", "", false, "",
		)
		return &Logs{nub: n, ctx: ctx, stop: make(chan struct{})}, nil
	}
	return nil, errors.New("resingo: no pubnub details found")
}