Code Monkey home page Code Monkey logo

timbre-util's Introduction

timbre-util

Convenience functions on top of a timbre configuration which are useful for the SkyBet Data team.

Install


Add the following entry to the :dependencies vector of your project.clj file:

[clojars version] (https://clojars.org/ccfontes/timbre-util)

Usage


Toggling logs on or off:

user=> (require '[timbre-util.log :as log])
nil

user=> (log/set-config!)
;{:level :debug, :output-fn #<timbre$default_output_fn taoensso.timbre$default_output_fn@17870ed0>, :appenders {:color-appender {:enabled? false, :async? false, :min-level nil, :rate-limit nil, :output-fn :inherit, :fn #<log$fn__2628$fn__2630 timbre_util.log$fn__2628$fn__2630@58235e48>}}}

user=> (info "flapjacks are yummy")
; default is to not print anything
nil

user=> (log/toggle!) ; toggles logging on
true

user=> (info "brownies ♡")
; 16-01-25 11:58:07 hungryman-MacBook-Pro.local INFO [skybet.some.ns] - brownies ♡

user=> (log/timbre! false) ; disables logging regardless if it's enabled or not
false

Features


Running (config-timbre!) will do the following:

  • set up beautiful colors for different levels of logging
  • disable logging until you run (toggle!)
  • Toggling logs on or off

Wishlist


  • project.clj config:
    • change colors
    • change enable logging default
    • inject utility fns on clojure.core for convenience

License


Copyright (C) 2016 Sky Betting and Gaming.

Released under The MIT License (MIT).

timbre-util's People

Contributors

ccfontes avatar

Watchers

 avatar  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.