https://github.com/tberey/simple-txt-logger
A Simple and Light-weight txt logging npm module. Log with ease, knowing you captured it all.
https://github.com/tberey/simple-txt-logger
easy easy-to-use light lightweight log logger logging logs module node nodejs npm package simple txt txt-based typescript
Last synced: 5 months ago
JSON representation
A Simple and Light-weight txt logging npm module. Log with ease, knowing you captured it all.
- Host: GitHub
- URL: https://github.com/tberey/simple-txt-logger
- Owner: tberey
- License: mit
- Created: 2021-07-09T19:31:23.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-19T13:01:10.000Z (about 1 year ago)
- Last Synced: 2025-08-29T23:10:17.667Z (10 months ago)
- Topics: easy, easy-to-use, light, lightweight, log, logger, logging, logs, module, node, nodejs, npm, package, simple, txt, txt-based, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/simple-txt-logger
- Size: 1.45 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[![Workflow][workflow-shield]][workflow-url]
[![Issues][issues-shield]][issues-url]
[![Version][version-shield]][version-url]
[![Stargazers][stars-shield]][stars-url]
[![Forks][forks-shield]][forks-url]
[![Contributors][contributors-shield]][contributors-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
SimpleTxtLogger
A simple and lightweight logging module,
by TomCo (Technology & Online Media Company)
NPM Link (Published)
Contents
-
About
- Installation
-
Usage
- Complete Setup Instructions
- Changelog
- Contributing
- Contact
- Acknowledgements
## About This Project
This is a simple and easy to use logging tool, that is also light-weight. It streams dynamically into a concise and pretty format, into .txt file, with all .txt files under one root directory (all done automatically). Simply add the module to your project,create a new instance for each logger you want, and away you go. For example you could create a new logger each for client-side or server-side logging separately, outputted to two txt files. See [Usage](#usage) and [Screenshots](#screenshots) for more information.
### Tech Stack
* [TypeScript](https://www.typescriptlang.org/) - Write in TypeScript (or JS), Compiles down to JavaScript.
* [Nodejs](https://nodejs.org/en/) - Node Runtime Environment.
* [fs](https://nodejs.org/api/fs.html) - Asynchronous File System methods.
* [ESLint](https://eslint.org/) - Code Parsing, Styling & Error Checking.
* Tested with [Mocha-Chai](https://mochajs.org/) - Testing with Mocha Framework, using the Chai Library.
## Installation
```sh
npm install simple-txt-logger
```
## Usage
By default, all .txt log files are placed in a 'logs' folder/directory, which is automatically created in the root folder of the app.
1. Create a new logger & log file, and continuously stream items or events to it:
*(Arguments are optional)*
```sh
const logger = new SimpleTxtLogger('', '', ''); //Create a logger instance.
```
```sh
logger.writeToLogFile(); //Logs an item to the loggers current .txt log file.
logger.getPath(); //Output: '/logs/*.txt'.
logger.close(); //Closes stream to the loggers .txt log file.
```
2. Create a single data log dump, to log an item or event into a single txt file, one time only:
*('Directory' Argument is optional)*
```sh
logger.dumpToNewTxtFile('', '', ''); //Create a single item log file.
```
### Screenshots
Logging Sample

Logging Sample#2

## Roadmap
Below is the refined and confirmed roadmap, that has been planned for completion. See [open issues][issues-url] and also the [project board][project-url], for any other proposed features or known issues, which may not be listed below.
| Feature/Task/Bugfix | Details | Version (if released) | Notes |
|:---|:---|:---|:---|
| Bug#1 | Bug details... | 0.0.1 | example#1 |
| Feature#4 | Feature details... | | example#2 |
## Changelog
| Version | Date | Changes |
|:---|:---|:---|
| 1.0.0 | 2021-07-09 |
- Initial Commit - Release Day!
- Add initial directory structure and files.
- Add Screenshots directory, and images.
- Create and format README.md
| 1.0.1, 1.0.2, 1.0.3 | 2021-07-14 |
- NPM Package Release Day!
- Update all dependencies.
- Remove old test commands from package.json and codeql.yml.
- Update README.md.
| 1.0.4, 1.0.5 | 2021-07-14 |
- NPM Package Release Day!
- Remove files and folders that are unnecessary to npm.
- Update README.md.
| 1.0.6 | 2021-07-16 |
- Update package.json
- Add npm keywords.
- Update README.md.
| 1.0.7 | 2021-08-03 |
- Update linked in url, in README.md.
## Contributing
Contributions are welcomed and, of course, **greatly appreciated**.
1. Fork the Project.
2. Create your Feature Branch (`git checkout -b feature/Feature`)
3. Commit your Changes (`git commit -m 'Add some Feature'`)
4. Push to the Branch (`git push origin feature/Feature`)
5. Open a Pull Request.
### Contact
Tom Berey; Project Manager, Lead Developer, Principal Tester & Customer Services;
tomberey1@gmail.com;
* [Issues & Requests.][issues-url]
* [My Other Projects.](https://github.com/tberey?tab=repositories)
* [Personal Website.](https://tberey.github.io/)
* [Linked In.](https://uk.linkedin.com/in/thomas-berey)
### Acknowledgements
* [Me](https://github.com/tberey)
[workflow-shield]: https://github.com/tberey/simple-txt-logger/actions/workflows/codeql-analysis.yml/badge.svg
[workflow-url]: https://github.com/tberey/simple-txt-logger/actions
[version-shield]: https://img.shields.io/github/v/release/tberey/simple-txt-logger
[version-url]: https://github.com/tberey/simple-txt-logger/releases/
[stars-shield]: https://img.shields.io/github/stars/tberey/simple-txt-logger.svg
[stars-url]: https://github.com/tberey/simple-txt-logger/stargazers
[contributors-shield]: https://img.shields.io/github/contributors/tberey/simple-txt-logger.svg
[contributors-url]: https://github.com/tberey/simple-txt-logger/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/tberey/simple-txt-logger.svg
[forks-url]: https://github.com/tberey/simple-txt-logger/network/members
[issues-shield]: https://img.shields.io/github/issues/tberey/simple-txt-logger.svg
[issues-url]: https://github.com/tberey/simple-txt-logger/issues
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?logo=linkedin&colorB=555
[linkedin-url]: https://uk.linkedin.com/in/thomas-berey
[project-url]: https://github.com/tberey/simple-txt-logger/projects