github.com/brownsys/tracing-framework-go@v0.0.0-20161210174012-0542a62412fe/xtrace/client/test/main.go (about)

     1  // +build !local
     2  
     3  package main
     4  
     5  import (
     6  	"fmt"
     7  	"os"
     8  	"sync"
     9  	"time"
    10  
    11  	"github.com/brownsys/tracing-framework-go/xtrace/client"
    12  )
    13  
    14  func main() {
    15  	err := client.Connect("localhost:5563")
    16  	if err != nil {
    17  		fmt.Fprintf(os.Stderr, "connect to X-Trace server: %v\n", err)
    18  		os.Exit(1)
    19  	}
    20  
    21  	client.Log("1")
    22  	client.Log("2")
    23  	client.Log("3")
    24  
    25  	var wg sync.WaitGroup
    26  	wg.Add(1)
    27  	go func() {
    28  		client.Log("4")
    29  		wg.Done()
    30  	}()
    31  
    32  	client.Log("5")
    33  	wg.Wait()
    34  
    35  	time.Sleep(time.Hour)
    36  }