You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client.go
    path of file: ./repos/juju/logfwd/syslog
    
    the code of the file until where you have to start completion: // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package syslog

import (
	"crypto/tls"
	"fmt"
	"io"
	"time"

	"github.com/juju/errors"
	"github.
    
func messageFromRecord(rec logfwd.Record) (rfc5424.Message, error) {
	msg := rfc5424.Message{
		Header: rfc5424.Header{
			Priority: rfc5424.Priority{
				Severity: rfc5424.SeverityWarning,
				Facility: rfc5424.FacilityUser,
			},
			Timestamp: rfc5424.Timestamp{rec.Timestamp},
			Hostname: rfc5424.Hostname{
				FQDN: rec.Origin.Hostname,
			},
			AppName: rfc5424.AppName((rec.Origin.Software.Name + "-" + rec.Origin.ModelUUID)[:48]),
		},
		StructuredData: rfc5424.StructuredData{
			&sdelements.Origin{
				EnterpriseID: sdelements.OriginEnterpriseID{
					Number: sdelements.PrivateEnterpriseNumber(rec.Origin.Software.PrivateEnterpriseNumber),
				},
				SoftwareName:    rec.Origin.Software.Name,
				SoftwareVersion: rec.Origin.Software.Version,
			},
			&sdelements.Private{
				Name: "model",
				PEN:  sdelements.PrivateEnterpriseNumber(rec.Origin.Software.PrivateEnterpriseNumber),
				Data: []rfc5424.StructuredDataParam{{
					Name:  "controller-uuid",
					Value: rfc5424.StructuredDataParamValue(rec.Origin.ControllerUUID),
				}, {
					Name:  "model-uuid",
					Value: rfc5424.StructuredDataParamValue(rec.Origin.ModelUUID),
				}},
			},
			&sdelements.Private{
				Name: "log",
				PEN:  sdelements.PrivateEnterpriseNumber(rec.Origin.Software.PrivateEnterpriseNumber),
				Data: []rfc5424.StructuredDataParam{{
					Name:  "module",
					Value: rfc5424.StructuredDataParamValue(rec.Location.Module),
				}, {
					Name:  "source",
					Value: rfc5424.StructuredDataParamValue(fmt.Sprintf("%s:%d", rec.Location.Filename, rec.Location.Line)),
				}},
			},
		},
		Msg: rec.Message,
	}

	switch rec.Level {
	case loggo.ERROR:
		msg.Priority.Severity = rfc5424.SeverityError
	case loggo.WARNING:
		msg.Priority.Severity = rfc5424.SeverityWarning
	case loggo.INFO:
		msg.Priority.Severity = rfc5424.SeverityInformational
	case loggo.DEBUG, loggo.TRACE:
		msg.Priority.Severity = rfc5424.SeverityDebug
	default:
		return msg, errors.Errorf("unsupported log level %q", rec.Level)
	}

	if err := msg.Validate(); err != nil {
		return msg, errors.Trace(err)
	}
	return msg, nil
}