Giter Site home page Giter Site logo

driftwood.js's Introduction

driftwood.js

Driftwood a dirt simple logging framework for javascript

The following goals of driftwood :

  • Logging should be simple, this isn't java we don't need abstract interfaces just a few simple options.
  • 4 Log levels thats it.
  • Allow exceptions or logs to be sent to a backend server. If an error falls in the forrest and no one hears it did it really happen?

We have a static logger called Driftwood, feel free to call the usual methods on it, debug, info, error.

Driftwood.debug("test"); 

We have one special one, this one will send it to your back end

Driftwood.exception("message")

We have two default environment, development and production. Production only shows errors on the console. Development shows all errors.

Driftwood.env("development"); //Debug and everything

If you need multiple instances of loggers just make a new one.

var my_logger = new Driftwood.logger();
my_logger.env("production");
my_logger.debug("instance logger : Should not see this");
my_logger.error("instance logger : should see this");

To configure log levels

my_logger.log_level("INFO")
Driftwood.log_level("ERROR")

By default any uncaught exceptions in your application's window will goto Driftwood, to manually send one

Driftwood.exception("Message here")
Driftwood.exception(exception_obj)

To configure your backend url. *note this is cross origin safe since we use gets

Driftwood.url("/errors/test?payload=")

To check out a nicely formatted help page of the source code

Commented source code

To contribute to this project please fork, and add tests to whatever you change so its easier to maintain. See the test folder for jasmine tests and open specrunner.html.

driftwood.js's People

Contributors

mattkanwisher avatar dmichael avatar

Watchers

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