<commit_before><commit_msg>updated doc and test, added log service<commit_after>package endly

import (
	"fmt"
)

const (
	//LogServiceID represents log service id.
	LogServiceID = "log"

	//LogServicePrintAction represents log action
	LogServicePrintAction = "print"
)

//Log represent no operation
type LogPrintRequest struct {
	Message string
	Error   string
}

//LogService represents no operation service
type LogService struct {
	*AbstractService
}

//Run run supplied request
func (s *LogService) Run(context *Context, request interface{}) *ServiceResponse {
	startEvent := s.Begin(context, request, Pairs("request", request))
	var response = &ServiceResponse{Status: "ok", Response: struct{}{}}
	switch request.(type) {
	case *LogPrintRequest:
	default:
		response.Error = fmt.Sprintf("unsupported request type: %T", request)
	}

	if response.Error != "" {
		response.Status = "error"
	}

	defer s.End(context)(startEvent, Pairs("response", response))
	return response
}

//NewRequest returns a new request for supplied action
func (s *LogService) NewRequest(action string) (interface{}, error) {
	switch action {
	case LogServicePrintAction:
		return &LogPrintRequest{}, nil

	}
	return s.AbstractService.NewRequest(action)
}

//NewRequest returns a new request for supplied action
func (s *LogService) NewResponse(action string) (interface{}, error) {
	switch action {
	case LogServicePrintAction:
		return struct{}{}, nil
	}
	return s.AbstractService.NewResponse(action)
}

//NewLogService creates a new log service.
func NewLogService() Service {
	var result = &LogService{
		AbstractService: NewAbstractService(LogServiceID,
			LogServicePrintAction,
		),
	}
	result.AbstractService.Service = result
	return result
}
{'fraction_non_alphanumeric': 0.10584152689415847, 'fraction_numerical': 0.0, 'mean_word_length': 5.156583629893238, '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': '5850405', 'n_tokens_mistral': 511, 'n_tokens_neox': 498, 'n_words': 155}