Giter Site home page Giter Site logo

jslog's Introduction

JS Log

My logging library util for JavaScript/TypeScript projects.

Creates a logs/ folder in the root of your project and generates MM-DD-YYYY.log files. Prints formatted/expanded objects aswell.

Log files will have content, example:

[12/29/2023 at 16:01:59 | D: 0s] [INFO]: test 

Where "D: 0s" is the time since the last message. I love having this little feature in my logs because I like to quickly see how far apart messages are (Ex for purchases, errors, etc.).

The library also uses the native console.log (Or warn/error) function to print, so formatted objects will show. These messages do not contain the timestamp or diff for cleanliness sake.

Usage

Just import the logInfo/logWarn/logError function and call it with your string/object. Just like the console.log function it accepts multiple arguments.

import { logInfo } from '@ultimategg/logging';

logInfo('Hello', { a: true });

The reason I used function names and not params (Ex LogType.WARN) is just for developer experience and being brief.

jslog's People

Contributors

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