1.0.7 • Published 3 years ago

simple-txt-logger v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Workflow Issues Version Stargazers Forks Contributors LinkedIn

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 and Screenshots for more information.

Tech Stack

  • TypeScript - Write in TypeScript (or JS), Compiles down to JavaScript.
  • Nodejs - Node Runtime Environment.
  • fs - Asynchronous File System methods.
  • ESLint - Code Parsing, Styling & Error Checking.
  • Tested with Mocha-Chai - Testing with Mocha Framework, using the Chai Library.

Installation

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)

    const logger = new SimpleTxtLogger('<FileName?>', '<Env?>', '<AppName?>');    //Create a logger instance.
    logger.writeToLogFile(<ItemToLog>);    //Logs an item to the loggers current .txt log file.
    
    logger.getPath();                      //Output: '<path>/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)

    logger.dumpToNewTxtFile('<ItemToLog>', '<FileName>', '<Directory?>');    //Create a single item log file.

Screenshots

Logging Sample Screenshot#1

Logging Sample#2 Screenshot#2

Roadmap

Below is the refined and confirmed roadmap, that has been planned for completion. See open issues and also the project board, for any other proposed features or known issues, which may not be listed below.

Feature/Task/BugfixDetailsVersion (if released)Notes
Bug#1Bug details...0.0.1example#1
Feature#4Feature details...example#2

Changelog

VersionDateChanges
1.0.02021-07-09Initial 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.32021-07-14NPM Package Release Day!Update all dependencies.Remove old test commands from package.json and codeql.yml.Update README.md.
1.0.4, 1.0.52021-07-14NPM Package Release Day!Remove files and folders that are unnecessary to npm.Update README.md.
1.0.62021-07-16Update package.jsonAdd npm keywords.Update README.md.
1.0.72021-08-03Update 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;

Acknowledgements

TomCo (Technology & Online Media Company ©)

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago