Skip to content

A lightweight Go client for sending debugging information to the LaraDumps desktop application. Allows dumping values, JSON, structs, tables, labels, and development-only logs — similar to `dd()` in Laravel.

License

Notifications You must be signed in to change notification settings

laradumps/laradumps-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaraDumps

Available for Windows, Linux and macOS.

📚 Documentation


👋 Hello Dev,

A lightweight Go client for sending debugging information to the LaraDumps desktop application.
Allows dumping values, JSON, structs, tables, labels, and development-only logs — similar to dd() in Laravel.


1. Installation

go get github.com/laradumps/laradumps-go

2. Basic Usage (Direct)

package main

import "github.com/laradumps/laradumps-go/ds"

func main() {
    ds.Clear()

    ds.Ds("hello")
	
    ds.Ds(42)
	
    ds.Ds(true)
	
    ds.Ds(map[string]any{"x": 1})
	
    ds.Ds([]int{1, 2, 3})
	
    ds.Ds(struct{ Name string }{"Luan"})

    ds.Table([]map[string]any{
        {"Name": "Luan", "Age": 35},
        {"Name": "Samuka", "Age": 23},
    })

    ds.Label("Custom Label")
	
    ds.Dsd("Dump and Die")
}

3. Usage in Development Only

To enable LaraDumps only in development, you can use Go build tags. This ensures dumps never go to production and no cleanup is required.


Development mode:

touch log_dev.go
//go:build dev

package main

import "github.com/laradumps/laradumps-go/ds"

func Ds(v ...interface{}) {
    Ds.Ds(v...)
}

Production mode:

touch log_prod.go
//go:build !dev

package main

import "fmt"

func Ds(v ...interface{}) {
    fmt.Println(v...) // or empty
}
package main

func main() {
	// Calls to ds() will be replaced with fmt.Println() in production mode

	Ds("This will only be dumped in development mode")
	Ds(struct{ Name string }{"Luan"})
}
  • Running in dev mode
go run -tags dev .
  • Running in prod mode
go run .

Credits

Licence

MIT

About

A lightweight Go client for sending debugging information to the LaraDumps desktop application. Allows dumping values, JSON, structs, tables, labels, and development-only logs — similar to `dd()` in Laravel.

Topics

Resources

License

Stars

Watchers

Forks

Languages