GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Tincre/logger: A console.log wrapper for TypeScript projects

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
.vscode
.vscode
 
 
src
src
 
 
test
test
 
 
.env
.env
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jest.config.js
jest.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

@tincre/logger

npm package
Build Status
Downloads
Issues
Code Coverage
Commitizen Friendly
Semantic Release

Install

npm install @tincre/logger

Usage

import { logger } from '@tincre/logger';

logger.debug('Debugging message');
logger.log('Application started');
logger.warn('This is a warning');
logger.error('Unexpected error occurred', new Error('Something went wrong'));

API

logger.log(message, data?)

Logs a standard message to the console if NODE_ENV is not set to production.

Parameters:

  • message: string - The main log message.
  • data (optional): unknown - Additional data (object, array, string, etc.).

Example:

logger.log('User logged in', { userId: 123 });

logger.error(message, data?)

Logs an error message to the console if NODE_ENV is not set to production.

Parameters:

  • message: string - The error message.
  • data (optional): unknown - Additional error details.

Example:

logger.error('Database connection failed', new Error('Connection timeout'));

logger.warn(message, data?)

Logs a warning message to the console if NODE_ENV is not set to production.

Parameters:

  • message: string - The warning message.
  • data (optional): unknown - Additional details.

Example:

logger.warn('Low disk space', { availableGB: 2 });

logger.debug(message, data?)

Logs a debug message to the console if NODE_ENV is not set to production.

Parameters:

  • message: string - The debug message.
  • data (optional): unknown - Additional debug info.

Example:

logger.debug('Fetching API data', { endpoint: '/users', method: 'GET' });

Environment Variables

Variable Description
NODE_ENV Set to "production" to disable logging in production environments.

Contributing

We welcome contributions! Please follow our commit guidelines and open issues if you encounter any problems.


About

A console.log wrapper for TypeScript projects

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

Generated from ryansonshine/typescript-npm-package-template
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.