Simple Yet Powerful Logger

Overview

sypl

sypl provides a Simple Yet Powerful Logger built on top of the Golang sypl. A sypl logger can have many Outputs, and each Output is responsible for writing to a specified destination. Each Output can have multiple Processors, which run in isolation manipulating the log message. The order of execution is important, and is according to the registering (add) order. These features allow sypl to fit into many different logging flows.

Install

$ go get github.com/saucelabs/sypl

Specific version

Example: $ go get github.com/saucelabs/[email protected]

Usage

See example/ folder, and sypl_test.go file.

Documentation

Run $ make doc or check out online.

How it works

A picture worth thousand words.

high-level-arch

Development

Check out CONTRIBUTION.

Release

  1. Update CHANGELOG accordingly.
  2. Once changes from MR are merged.
  3. Tag and release.

Roadmap

Check out CHANGELOG.

You might also like...
A Simple logger for golang

go-logger Installation go get github.com/mo-taufiq/go-logger Quickstart package main import ( gologger "github.com/mo-taufiq/go-logger" ) func main

Simple Proof of Concept REST event logger.

REST Event Logger PoC I am working on this project intermittently. I have set myself a time limit of ~3hrs which includes the time to acquire and adap

Golog is a logger which support tracing and other custom behaviors out of the box. Blazing fast and simple to use.

GOLOG Golog is an opinionated Go logger with simple APIs and configurable behavior. Why another logger? Golog is designed to address mainly two issues

A logger, for Go

Go-Log A logger, for Go! It's sort of log and code.google.com/p/log4go compatible, so in most cases can be used without any code changes. Breaking cha

Loggly Hooks for GO Logrus logger

Loggly Hooks for Logrus Usage package main import ( "github.com/sirupsen/logrus" "github.com/sebest/logrusly" ) var logglyToken string = "YOUR_LOG

A 12-factor app logger built for performance and happy development
A 12-factor app logger built for performance and happy development

logxi log XI is a structured 12-factor app logger built for speed and happy development. Simpler. Sane no-configuration defaults out of the box. Faste

A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.
A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

SQLDB-Logger A logger for Go SQL database driver without modify existing *sql.DB stdlib usage. Colored console writer output above only for sample/dev

xlog is a logger for net/context aware HTTP applications
xlog is a logger for net/context aware HTTP applications

⚠️ Check zerolog, the successor of xlog. HTTP Handler Logger xlog is a logger for net/context aware HTTP applications. Unlike most loggers, xlog will

Zero Allocation JSON Logger
Zero Allocation JSON Logger

Zero Allocation JSON Logger The zerolog package provides a fast and simple logger dedicated to JSON output. Zerolog's API is designed to provide both

Comments
  • Redirect standard logger

    Redirect standard logger

    Add functionality to redirect the standard logger to a Sypl logger with either RedirectStdLog that redirects to level.INFO, or RedirectStdLogAt that takes a level.Level argument.

    opened by amckenzie132 0
  • v1.5.8

    v1.5.8

    • All SetXYZ methods returns its proper interface allowing method chaining.
    • Breakpoint is now variadic.
    • Properly handle cases where sypl writes to a piped output, but it's broken.
    enhancement 
    opened by thalesfsp 0
Releases(v1.5.12)
  • v1.5.12(Apr 21, 2022)

  • v1.5.11(Feb 26, 2022)

  • v1.5.10(Feb 22, 2022)

  • v1.5.9(Feb 22, 2022)

    Added

    • For convenience, conforms with io.Writer interface. Default level: error. SetIoWriterLevel changes the default level.

    Changed

    • Fixed chained example.
    • Lowercased all levels.
    • It now warns when an application tries to write to a closed writer.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.8(Nov 8, 2021)

    • All SetXYZ methods returns its proper interface allowing method chaining.
    • Breakpoint is now variadic.
    • Properly handle cases where sypl writes to a piped output, but it's broken.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.7(Nov 2, 2021)

  • v1.5.6(Nov 2, 2021)

    Added the ability to set breakpoints. If a Breakpoint is set it'll stop execution waiting the user press /n ("enter") to continue. It helps users doing quick, and effective log-to-console debug. A message with the breakpoint name, and PID of the process will be printed using the debug level. Arbitrary data can optionally be set - if set, it'll be printed. Errors are printed using the standard error level. Set logging level to trace for more.

    Previously, flow would look like:

    • Log markers are set, e.g.: logger.Debugln("Here 1", whatever)
    • Application runs
    • Scan visually output, or a file - via grep for the markers.

    Now:

    • Named Breakpoints are set
    • Application runs
    • Breakpoint is hit. Information about it is printed.
    • Runtime is paused, allowing analysis of data - if any, right way. Additionally, an external and more advanced debugger can be attached.
    • Dev controls the flow, pressing enter at any time, continue.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.5(Oct 29, 2021)

  • v1.5.4(Oct 14, 2021)

    • Renamed logging component filtering env var from SYPL_DEBUG to SYPL_FILTER.

    In a application with many loggers, and child loggers, sometimes more fine control is needed, specially when debugging applications. Sypl offers two powerful ways to achieve that: SYPL_FILTER, and SYPL_DEBUG env vars.

    SYPL_FILTER allows to specify the name(s) of the component(s) that should be logged, for example, for a given application with the following loggers: svc, pv, and cm, if a developer wants only to see svc, and pv logging, it's achieved just setting SYPL_FILTER="svc,pv".

    SYPL_DEBUG allows to specify the max level, for example, for a given application with the following loggers: svc, pv, and cm, if a developer sets:

    • SYPL_DEBUG="debug": any application running using Sypl, any component, any output, will log messages bellow the debug level
    • SYPL_DEBUG="console:debug": any application running using Sypl with an output called console, will log messages bellow the debug level
    • SYPL_DEBUG="warn,console:debug": any application running using Sypl, any component, any output, will log messages bellow the warn level, AND any application running using Sypl with an output called console, will log messages bellow the debug level.

    NOTE: warn is specified first. Only for this case - global scope, it's a requirement. SYPL_DEBUG="console:debug,warn": In this case warn will be discarded!.

    • SYPL_DEBUG="svc:console:debug": any application running using Sypl with a component called svc with an output called console, will log messages bellow the debug level
    • SYPL_DEBUG="file:warn,svc:console:debug": any application running using Sypl with an output called file will log messages bellow the warn level, and any application running using Sypl with a component called svc with an output called console will log messages bellow the debug.

    Possible scopes:

    • {componentName:outputName:level}: Component, and output scoped
    • {outputName:level}: Output scoped
    • {level}: Global scope

    The possibilities are endless! Checkout the debugAndFilter example for more.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.3(Sep 21, 2021)

  • v1.5.2(Sep 21, 2021)

  • v1.5.1(Sep 11, 2021)

  • v1.5.0(Sep 11, 2021)

  • v1.4.6(Aug 30, 2021)

  • v1.4.5(Aug 30, 2021)

    • StdErr now only prints Error AND Fatal instead of only Error.
    • Console now ignores Error AND Fatal instead of only Error.
    • PrintOnlyAtLevel now handle multiples levels.
    • FromString now returns the level, and error instead of level, and bool (ok).
    • Internal sypl.process is now validated. In case of failure it throws ErrSyplNotInitialized.
    • All error.go files were renamed to errors.go, following Go standards.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.4(Aug 20, 2021)

  • v1.4.3(Aug 20, 2021)

  • v1.4.2(Aug 19, 2021)

  • v1.4.1(Aug 19, 2021)

  • v1.4.0(Aug 19, 2021)

  • v1.3.11(Aug 19, 2021)

  • v1.3.10(Aug 19, 2021)

  • v1.3.9(Aug 18, 2021)

  • v1.3.8(Aug 18, 2021)

  • v1.3.7(Aug 18, 2021)

  • v1.3.6(Aug 18, 2021)

  • v1.3.5(Aug 18, 2021)

  • v1.3.4(Aug 18, 2021)

  • v1.3.3(Aug 14, 2021)

  • v1.3.2(Aug 14, 2021)

    • Adds PrintMessagerPerOutput which allows you to concurrently print messages, each one, at the specified level and to the specified output. If the named output doesn't exits, the message will not be printed.
      • Covered with test.
    • Adds output field to Text and JSON formatters.
    Source code(tar.gz)
    Source code(zip)
Owner
Sauce Labs
Sauce Labs
Convenient Logger interface and std logger wrapper

Convenient logger interface and wrapper around std logger Interface type Logger interface { Error(err error) Debugf(format string, args ...interface

Denis Mitrofanov 1 Nov 28, 2021
Logger - A thin wrapper of uber-go/zap logger for personal project

a thin wraper of uber-go/zap logger for personal project 0. thanks uber-go/zap B

tsingson 0 Sep 17, 2022
A powerful zero-dependency json logger.

ZKits Logger Library About This package is a library of ZKits project. This is a zero-dependency standard JSON log library that supports structured JS

Qingshan Luo 23 Dec 14, 2022
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Amanpreet Singh 283 Dec 17, 2022
Dead simple, super fast, zero allocation and modular logger for Golang

Onelog Onelog is a dead simple but very efficient JSON logger. It is one of the fastest JSON logger out there. Also, it is one of the logger with the

Francois Parquet 402 Sep 26, 2022
simple concurrent logger

XMUS-LOGGER pure golang logger compatible with golang io standards. USAGE : logOptions := logger.LoggerOptions{ LogLevel: 6, // read more about lo

amupxm [amir hossein mokarrami far] 6 Aug 1, 2022
🪵 A dead simple, pretty, and feature-rich logger for golang

?? lumber ?? A dead simple, pretty, and feature-rich logger for golang ?? Install ?? Logging Functions lumber.Success() lumber.Info() lumber.Debug() l

Matt Gleich 50 Jul 20, 2022
A simple logger API.

flog a simple logger API for Go program that save logs into a file. NOTE: This package is provided "as is" with no guarantee. Use it at your own risk

Iss Meftah 3 May 14, 2022
A simple Go JSON logger.

logger A simple JSON logger for Go. It uses a context.Context to store values which will then be logged along with each message. It is possible to rec

Shawn Milochik 2 Jul 25, 2022
A simple and super power logger for golang

The most powerfull and faster logger for golang powered by DC ?? What is this? W

Teo 6 Oct 18, 2022