gml

Go Muse Logger ⚡ Graylog integrated Zap logger

1 week after

Go Muse Logger

GoDoc CircleCI codecov

Getting Stated

To use gml, simply import:

import "github.com/dailymuse/gml"

Example Usage

package main

import (
    "time"

    "github.com/dailymuse/gml"
)

func main() {
    // Instantiate a global logger.
    if err := gml.New(&gml.Config{
        AppName: "app-name",
        IsProdEnv: true,
        IsStagingEnv: false,
        IsTestEnv: false,
        GraylogAddress: "127.0.0.1",
        GraylogPort: 1234,
        GraylogVersion: "1.1",
        Hostname: "myhostname",
        UseTLS: true,
        InsecureSkipVerify: true,
        LogEnvName: "prod",
        GraylogConnectionTimeout: time.Second * 3,
    }); err != nil {
        panic(err)
    }

    // Example Info log.
    gml.Logger.Info("this is an example Info log",
        gml.Error(errors.New("example error")),
        gml.String("process name", "some-fake-name"),
    )

    // Example Error log.
    gml.Logger.Error("this is an example Error log",
        gml.Int64("docsUploaded", int64(100)),
        gml.Int64("expectedDocs", int64(255)),
        gml.String("index name", "my-full-index-name"),
        gml.Float64("time elapsed", float64(1002)),
    )
}

Related Repositories

Loader

Loader

Simple GML & KML loader written in Python using OGR ...

canvasplayer

canvasplayer

Graffiti Markup Language (GML) playback using <canvas> & Processing.js ...

gml-pro

gml-pro

A large collection of shaders, images and utility functions for GameMaker Studio ...

blackbook

blackbook

#000000book - an open database for Graffiti Markup Language (GML) files ...

gdash

gdash

A functional utility library for GML - partials, map/reduce and more ...