Component evidence

handleLog (map_demo/main.go)

centrifuge · _examples/map_demo/main.go · go · MIT
database

Logs Centrifuge server events to standard output.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/centrifugal/centrifuge | License: MIT | Copyright 2023 Centrifugal Labs LTD
// Provided via justclaw.it.com; keep this notice with the code.
package main

import (
	"context"
	"errors"
	"flag"
	"log"
	"net/http"
	"os"
	"os/signal"
	"strings"
	"syscall"
	"time"

	"github.com/centrifugal/centrifuge"
)

func handleLog(e centrifuge.LogEntry) {
	log.Printf("[centrifuge] %s: %v", e.Message, e.Fields)
}

var (
	port      = flag.String("port", "3000", "HTTP server port")
	redisAddr = flag.String("redis", "", "Redis address (e.g., localhost:6379). If empty, uses in-memory broker.")
)

func main() {
	flag.Parse()

	node, err := centrifuge.New(centrifuge.Config{
		LogLevel:   centrifuge.LogLevelDebug,
		LogHandler: handleLog,
		GetChannelMediumOptions: func(channel strin

... (truncated -- full source via MCP)