Skip to content
noa-logPublic

About

Noa echo integration module

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Noa Echo

The Echo integration module for Noa Log, enabling quick integration of Noa into the Echo framework.

Installation

go get -u github.com/noa-log/noa-echo

Quick Start

package main

import (
    "net/http"
    "github.com/labstack/echo/v4"
    "github.com/noa-log/noa"
    "github.com/noa-log/noa-echo"
)

func main() {
    // Create a new logger instance
    logger := noa.NewLog()
    logger.Errors.CallerSkip = 4

    // Create an Echo instance
    e := echo.New()
    // Replace the default logger with the Noa Echo logger instance
    e.Logger = noaecho.New(logger)

    e.GET("/", func(c echo.Context) error {
        e.Logger.Info("Hello, World!")

        return c.String(http.StatusOK, "Hello, World!")
    })

    if err := e.Start("localhost:1323"); err != nil {
        panic(err)
    }
}

License

This project is open-sourced under the Apache License 2.0. Please comply with the terms when using it.

About

Noa echo integration module

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages