Code Monkey home page Code Monkey logo

sugaredgorm's Introduction

Version Go Documentation Go Report Card Go Build Status GolangCI-Lint Status codecov Powered by Rake

Sugared Gorm

Custom GORM logger implementation enhanced with SugarLogger for improved log level management and standardized log outputs.

Features

  • Integrate GORM database logging with the powerful SugarLogger library.
  • Easily manage log levels and control verbosity for debugging.
  • Standardized and customizable log outputs for better readability and analysis.

Installation

Now you can add this package via;

go get -u github.com/erhanakp/sugaredgorm

Install godoc for documentation;

go install golang.org/x/tools/cmd/godoc@latest

Usage:

zap := zap.NewExample()

gormLoggerValue := sugaredgorm.New(zap.Sugar(), sugaredgorm.Config{
	SlowThreshold:             200 * time.Millisecond,
	Colorful:                  true,
	IgnoreRecordNotFoundError: true,
	ParameterizedQueries:      true,
})

_, err := gorm.Open(postgres.New(postgres.Config{
	DSN: "host=localhost",
}), &gorm.Config{
	Logger: gormLoggerValue,
})

Rake Tasks

rake -T

rake bump[revision]     # bump version, default is: patch
rake doc[port]          # run doc server
rake lint               # run golangci-lint
rake publish[revision]  # publish new version of the library, default is: patch
rake test               # run tests

Contributor(s)


Contribute

All PR’s are welcome!

  1. fork (https://github.com/erhanakp/sugaredgorm/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'add some functionality')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


License

This project is licensed under MIT

sugaredgorm's People

Contributors

erhanakp avatar vigo avatar

Stargazers

Yiğithan Karabulut avatar Omid Nasiri avatar mookrs avatar Hakan Kutluay avatar Kerem Dokumacı avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

teammadduck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.