logging

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

README

Go-Lang API Scaffold

Scaffold project for APIs created on Bebet

Framework

  • Web : GoFiber
  • Validation : Go-Ozzo
  • Configuration : GoDotEnv
  • Log : Fiberzap
  • Swagger : swagger contrib gofiber

Architecture

Controller -> Service -> Repository

Environment required to run

  • File .env

    MONGO_URI=mongodb://mongo:mongo@localhost:27017 # replace localhost with your mongo host if you are using docker
    MONGO_DATABASE=golang
    MONGO_POOL_MIN=10
    MONGO_POOL_MAX=100
    MONGO_MAX_IDLE_TIME_SECOND=60
    
  • Docker and Docker-Compose

  • AIR (Hot reload)

    Air is a tool to hot reload your code when you save it.

    Install:

    curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
    
Running
docker-compose up -d
air

Documentation

Index

Constants

View Source
const (
	INFO  = "INFO"  // Stack Trace
	STACK = "STACK" // Stack Trace
	MEM   = "MEM"   // Memory Stats
	GC    = "GC"    // GC Stats
	BUILD = "BUILD" // Build Info
	ALL   = "ALL"   // All Stats
)

DebugOptions is a type for debug options

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(appName string, appModuleName string)

Types

type DebugOptions added in v0.1.2

type DebugOptions struct {
	Enabled bool
	Level   string
}

type Level

type Level int

func (Level) String

func (d Level) String() string

String returns the string representation of the SignalDirection.

type Logger added in v0.1.2

type Logger struct {
	Logs logr.Logger
}
var Logging Logger

func (*Logger) Debug added in v0.1.2

func (logger *Logger) Debug(msg string, options DebugOptions, keysAndValues ...interface{})

func (*Logger) Error added in v0.1.2

func (l *Logger) Error(err exception.TradingError, keysAndValues ...interface{})

func (*Logger) Info added in v0.1.2

func (l *Logger) Info(msg string, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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