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: log.go
    path of file: ./repos/Spark/server/common
    
    the code of the file until where you have to start completion: package common

import (
	"Spark/server/config"
	"Spark/utils"
	"Spark/utils/melody"
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/kataras/golog"
	"io"
	"os"
	"time"
)

var logWriter *os.File
var disposed bool

func init() {
	setLogDst 
    
func getLog(ctx any, event, status, msg string, args map[string]any) string {
	if args == nil {
		args = map[string]any{}
	}
	args[`event`] = event
	if len(msg) > 0 {
		args[`msg`] = msg
	}
	if len(status) > 0 {
		args[`status`] = status
	}
	if ctx != nil {
		var connUUID string
		var targetInfo bool
		switch ctx.(type) {
		case *gin.Context:
			c := ctx.(*gin.Context)
			args[`from`] = GetRealIP(c)
			connUUID, targetInfo = c.Request.Context().Value(`ConnUUID`).(string)
		case *melody.Session:
			s := ctx.(*melody.Session)
			args[`from`] = GetAddrIP(s.GetWSConn().UnderlyingConn().RemoteAddr())
			if deviceConn, ok := args[`deviceConn`]; ok {
				delete(args, `deviceConn`)
				connUUID = deviceConn.(*melody.Session).UUID
				targetInfo = true
			}
		}
		if targetInfo {
			device, ok := Devices.Get(connUUID)
			if ok {
				args[`target`] = map[string]any{
					`name`: device.Hostname,
					`ip`:   device.WAN,
				}
			}
		}
	}
	output, _ := utils.JSON.MarshalToString(args)
	return output
}