Code Monkey home page Code Monkey logo

redlog's Introduction

Red Log

Latest Release Go Docs Build Status Go Report Card

Gloss styles for logs. πŸͺ΅

It contains a set of styles that can be used with the log package. The following themes are provided:

Gallery

Catppuccin Latte

catppuccin latte

Catppuccin FrappΓ©

catppuccin frappe

Catppuccin Macchiato

catppuccin macchiato

Catppuccin Mocha

catppuccin mocha

Usage

Use go get to download the dependency.

go get github.com/op/redlog@latest

Then, import it in Go files:

import (
  "github.com/charmbracelet/log"
  "github.com/op/redlog"
)

The Red Log package comes with a select few styles of the themes listed above. These are ready to be used straight away.

log.SetStyles(redlog.Catppuccin.Mocha)
slog.SetDefault(slog.New(log.Default()))

Specific theme

If you want to limit the number of dependencies, or make some customisation of the theme yourself, you can directly import and use the theme.

import (
  "github.com/charmbracelet/log"
  "github.com/op/redlog/pkg/catppuccin"
)

Then initiate the theme the way that suits your needs.

// use an adaptive theme that switches between light and dark depending on the
// terminal's color scheme
variant := catppuccin.Adaptive(catppuccin.Latte, catppuccin.Mocha)
log.SetStyles(catppuccin.Styles(variant))

redlog's People

Contributors

github-actions[bot] avatar op avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.