<commit_before>// Copyright © 2015 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.

package components

import (
	"fmt"
	"github.com/thethingsnetwork/core"
)

type Broker struct{}

func NewBroker() (*Broker, error) {
	return nil, nil
}
func (b *Broker) HandleUp(p core.Packet, an core.AckNacker, a core.Adapter) error {
	return nil
}

func (b *Broker) HandleDown(p core.Packet, an core.AckNacker, a core.Adapter) error {
	return fmt.Errorf("Not Implemented")
}

func (b *Broker) Register(r core.Registration) error {
	return nil
}
<commit_msg>[broker] Add New and log method to broker<commit_after>// Copyright © 2015 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.

package components

import (
	"fmt"
	"github.com/thethingsnetwork/core"
	"github.com/thethingsnetwork/core/utils/log"
)

type Broker struct {
	loggers []log.Logger
	db      addressKeeper
}

func NewBroker(loggers ...log.Logger) (*Broker, error) {
	localDB, err := NewLocalDB(EXPIRY_DELAY)

	if err != nil {
		return nil, err
	}

	return &Broker{
		loggers: loggers,
		db:      localDB,
	}, nil
}

func (b *Broker) HandleUp(p core.Packet, an core.AckNacker, a core.Adapter) error {
	return nil
}

func (b *Broker) HandleDown(p core.Packet, an core.AckNacker, a core.Adapter) error {
	return fmt.Errorf("Not Implemented")
}

func (b *Broker) Register(r core.Registration) error {
	return nil
}

func (b *Broker) log(format string, i ...interface{}) {
	for _, logger := range b.loggers {
		logger.Log(format, i...)
	}
}

{'fraction_non_alphanumeric': 0.11790123456790123, 'fraction_numerical': 0.0049382716049382715, 'mean_word_length': 3.942073170731707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6470142', 'n_tokens_mistral': 575, 'n_tokens_neox': 554, 'n_words': 187}