Skip to content

nghihua/sassy-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation


💅

Sassy Logger

A logger utility, but sassy.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

As an attempt to publish my first NPM package, I create this logger utility to basically prefix your logs with a sassy remark. Happy coding!

(back to top)

Getting Started

Installation

This package is hosted on NPM and therefore can be installed with:

  • npm
    npm install sassy-logger

Usage

Log with specific methods:

  import SassyLogger from 'sassy-logger';

  SassyLogger.debug("Initializing API client with parameters...");  
  // Output: [🔍 Just a little check-in] Initializing API client with parameters...

  SassyLogger.info("Server is running on port %d.", port);  
  // Output: [💤 It’s cute that you think this matters.] Server is running on port 3000

  SassyLogger.warn("API rate limit almost exceeded.");  
  // Output: [🤡 Plot twist...] API rate limit almost exceeded.

  SassyLogger.error("Unexpected shutdown.");  
  // Output: [🔥 Absolute disaster incoming] Unexpected shutdown.

  SassyLogger.fatal("System crash! Shutting down.");  
  // Output: [💀 Hope you updated your will] System crash! Shutting down.

  SassyLogger.oops("Missed a semicolon, causing the syntax error.");  
  // Output: [😬 That’s on you...] Missed a semicolon, causing the syntax error.

  SassyLogger.blessed("Successfully deployed the latest version!");  
  // Output: [✨ The universe has smiled upon us] Successfully deployed the latest version!

Generic log method:

  import SassyLogger from 'sassy-logger';

  // default
  SassyLogger.log("Returned value is 36.");  
  // Output: [🤷 Whatever] Initializing API client with parameters...

  // with level
  SassyLogger.log("Returned value is 36.", "debug");  
  // Output: [🔍 Just a little check-in] Initializing API client with parameters...

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Nghi Hua - https://nghihua.io.vn/

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published