Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngthucdotcom/use-logger
Basic Logger for JS
https://github.com/ngthucdotcom/use-logger
Last synced: about 2 months ago
JSON representation
Basic Logger for JS
- Host: GitHub
- URL: https://github.com/ngthucdotcom/use-logger
- Owner: ngthucdotcom
- License: mit
- Created: 2021-09-10T16:19:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T09:06:15.000Z (almost 3 years ago)
- Last Synced: 2024-10-08T15:09:33.561Z (3 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/use-logger
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# use-logger
useLogger hook for React.js## Usage
### Install package
```
npm i --save-dev use-logger
```### Use package
* Import to component
```
import {useLogger} from "use-logger";
```* Init class/function/component name for every component
```
const logger = useLogger();
```* Write log with type info | warning | error
```
logger.log_info(data, options);
```
```
logger.log_warn(data, options);
```
```
logger.log_error(data, options);
```## Development commands
```
// watch
yarn start// or
npm run start
``````
// builds the dist folder
yarn build// or
npm run build
```## Deployment to NPM
### Login to correct NPM account
```
npm login
```### Versioning
Increase the version number as per NPM guides [https://docs.npmjs.com/about-semantic-versioning].
```
// increases the first digit i.e. from 0.5.4 to 1.0.0
npm version major// increases the second digit i.e. from 0.0.3 to 0.1.0
npm version minor// increases the third digit i.e. from 0.0.1 to 0.0.2
npm version patch
```### Deployment
Run the command and the package should be up.
```
npm publish --access public
```