# loggear

> Modern logging package

Latest version **1.0.2** (published 2023-08-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install loggear
pnpm add loggear
yarn add loggear
bun add loggear
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-08-17 |
| First published | 2022-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | acecow |
| Maintainers | acecow |
| Keywords | log, logging, logger |

## Links

- npm: https://www.npmjs.com/package/loggear
- Repository: https://github.com/acecow/Logger
- Homepage: https://github.com/acecow/Logger#readme
- Issues: https://github.com/acecow/Logger/issues
- npm.io page: https://npm.io/package/loggear

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-08-17
- 1.0.1 — 2022-12-22
- 1.0.0 — 2022-12-22

## README

# <h1 align="center">Loggear</h1>
This is an easy-to-use logging library created by me, acecow, to serve the backend in our project. Below you will find brief documentation for my library.

# <h2 align="center">Docs</h2>
Before use, you must do a little setup. To set up the library, you must write this command:
```js
loggear.setUp("log.txt", true)
```
`log.txt` - file where logs will be stored. If the specified file does not exist, a file with the same name will be automatically created. You may also see an obscure argument with a value of `true`. With this argument
you can define whether to show the date or not. In order to be shown, as I wrote above, it must be `true`, in order not to be shown - `false`. If the value is not set to `true` or `false`, but, for example, a string, then the value will be automatically set to `false`. Let's look at an example:
```js
const loggear = require('loggear')

loggear.setUp("log.txt", true)

loggear.log("test")
loggear.error("test")
loggear.info("test")
```
The result of executing this code will be like this:
```
[LOG] 2022-12-22 16:46:34 --- test
[ERROR] 2022-12-22 16:46:34 --- test
[INFO] 2022-12-22 16:46:34 --- test
```
`log.txt:`
```
Logs
[LOG] 2022-12-22 16:47:56 --- test
[ERROR] 2022-12-22 16:47:56 --- test
[INFO] 2022-12-22 16:47:56 --- test
```
The `log`, `info` and `error` methods write logs to the console and file.
Or here is a code example with the value of the second argument set to `false`:
```js
const loggear = require('loggear')

loggear.setUp("log.txt", false)

loggear.log("test")
loggear.error("test")
loggear.info("test")
```
The result of executing this code will be like this:
```
[LOG] --- test
[ERROR] --- test
[INFO] --- test
```
The `log.txt` file after the previous example:
```
Logs
[LOG] 2022-12-22 16:47:56 --- test
[ERROR] 2022-12-22 16:47:56 --- test
[INFO] 2022-12-22 16:47:56 --- test
[LOG] --- test
[ERROR] --- test
[INFO] --- test
```

---
_Source: https://npm.io/package/loggear · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
