Skip to content

pravus/apphole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppHole - Simple app console logging service

Description

AppHole is a simple server and emitter implementation for sending log messages from applications that do not have direct terminal access. Its primary purpose is to facilitate quick and easy lightweight logging when debugging and tracing. It includes command line programs and library modules to be flexible and minimize overhead.

Synopsis

Server

Command line

From GitHub:

go run github.com/pravus/apphole/cmd/serve@v0.0.0

From a cloned repository:

go run ./cmd/serve

Custom server

    server, err := apphole.NewServer(apphole.ServerConfig{
        Host:       apphole.DefaultHost,
        Port:       apphole.DefaultPort,
        BufferSize: apphole.DefaultBufferSize,
    })
    if err != nil {
        return fmt.Errorf("failed to create apphole server: %w", err)
    }

    ...

    if err := server.Up(); err != nil {
        return fmt.Errorf("failed to start apphole server: %w", err)
    }

    ...

    if err := server.Down(); err != nil {
        return fmt.Errorf("failed to stop apphole server: %w", err)
    }

Emitter

Command line

From GitHub:

go run github.com/pravus/apphole/cmd/emit@v0.0.0 The quick brown fox jumped over the lazy dog.

From a cloned repository:

go run ./cmd/emit The quick brown fox jumped over the lazy dog.

Drop-in emitter using default host/port

import "github.com/pravus/apphole"

...

    apphole.Emit("The quick brown %s jumped over the lazy %s", "fox", "dog")

...

Custom emitter using default host/port

    client, err := apphole.NewClient(apphole.DefaultHost, apphole.DefaultPort)
    if err != nil {
        panic(err)
    }
    client.Emit("The quick brown %s jumped over the lazy %s", "fox", "dog")

About

Simple app console logging service

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages