Giter VIP home page Giter VIP logo

go-logger's Introduction

SyLog

Go Logger package adopted Cloud Native principles in core.

Usage Example

Please see below for example code.

package main

import "github.com/syniol/go-logger"

func main() {
	sylog.LogAlert("mock message for alert log")
}

you could see JSON output below:

{
  "level": "alert",
  "message": "mock message for alert log",
  "trace": [
    "location: file: '/Users/hadi/dev/golang/logger/logger.go' on line: 100"
  ],
  "timestamp": "2023-11-04T21:36:33Z"
}

Log levels

Log levels for software applications have a rich history dating back to the 1980s. One of the earliest and most influential logging solutions for Unix systems, Syslog , introduced a range of severity levels, which provided the first standardised framework for categorising log entries based on their impact or urgency.

The following are the levels defined by Syslog in descending order of severity:

  • Emergency (emerg/fatal): System is unusable and requires immediate attention.
  • Alert (alert): Immediate action is necessary to resolve a critical issue.
  • Critical (crit): Critical conditions in the program that demand intervention to prevent system failure.
  • Error (error): Error conditions that impair some operation but are less severe than critical situations.
  • Warning (warn): Potential issues that may lead to errors or unexpected behavior in the future if not addressed.
  • Notice (notice): Applies to normal but significant conditions that may require monitoring.
  • Informational (info): Includes messages that provide a record of the normal operation of the system.
  • Debug (debug): Logging detailed information about the system for debugging purposes.

Credits

Copyright © 2023 Syniol Limited. All rights Reserved.

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.