Log server ‘starting’ and ‘started’ messages

This commit is contained in:
Tobie Morgan Hitchcock 2017-03-24 21:35:46 +00:00
parent 5a558c0d6f
commit 79518591be
2 changed files with 10 additions and 1 deletions

View file

@ -87,7 +87,12 @@ func Setup(opts *cnf.Options) (err error) {
}
}()
// Log successful start
log.WithPrefix("tcp").Infof("Started tcp server on %s", opts.Conn.Tcp)
return
}
func Send(name string, data []byte) {

View file

@ -58,9 +58,13 @@ func Setup(opts *cnf.Options) (err error) {
// Check body size
s.Use(mw.Size(&mw.SizeOpts{
AllowedLength: 1 << 20,
AllowedLength: 1 << 20, // 1mb
}))
// Log successful start
log.WithPrefix("web").Infof("Started web server on %s", opts.Conn.Web)
// Run the server
if len(opts.Cert.Crt) == 0 || len(opts.Cert.Key) == 0 {