package main

import (
	"log"
	"os"
)

type Service struct {
	Name   string
	Logger *log.Logger
}

func NewService(n string, l *log.Logger) *Service {
	return &Service{
		Name:   n,
		Logger: l,
	}
}

func (s *Service) Init() {
	s.Logger.Printf("initializing : %s\n", s.Name)
}

func (s *Service) Stop() {
	s.Logger.Printf("shutting down: %s\n", s.Name)
}

func main() {
	l := log.New(os.Stdout, "[service] ", log.Lshortfile)
	s := NewService("example", l)
	s.Init()
	s.Stop()
}
