noaecho

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

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.

Documentation

Overview

* @Author: nijineko * @Date: 2025-06-11 10:42:11 * @LastEditTime: 2025-06-11 11:02:35 * @LastEditors: nijineko * @Description: noa echo log * @FilePath: \noa-echo\log.go

* @Author: nijineko * @Date: 2025-06-11 10:42:20 * @LastEditTime: 2025-06-11 10:49:55 * @LastEditors: nijineko * @Description: noa echo log * @FilePath: \noa-echo\noaecho.go

Index

Constants

This section is empty.

Variables

View Source
var (
	DEFAULT_LOG_SOURCE = "Echo"
)

Functions

func New

func New(Log *noa.LogConfig) *echoLogger

*

  • @description: New creates a new echo logger instance
  • @param {*noa.LogConfig} Log noa log instance
  • @return {*echoLogger} echo logger instance

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL