Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/souvikinator/logto
minimal NodeJs module to make log files on the go
https://github.com/souvikinator/logto
log-files logger logto nodejs nodejs-modules
Last synced: about 1 month ago
JSON representation
minimal NodeJs module to make log files on the go
- Host: GitHub
- URL: https://github.com/souvikinator/logto
- Owner: souvikinator
- License: mit
- Created: 2021-04-01T07:30:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T07:34:24.000Z (over 3 years ago)
- Last Synced: 2024-05-01T18:13:18.117Z (7 months ago)
- Topics: log-files, logger, logto, nodejs, nodejs-modules
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/logto
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logto
A minimal nodejs log file maker on the go.
If any bug is encountered, please do report.
## Todo
- [ ] Allow users to add custom logging function
## usage
```js
const logto=require('logto);
const testlogger=new logto({
dir:"your/preffered/dir",
file:"your_log_file_name.log"
});// do some stuff
testlogger.log("this is first write");
// do some stuff
testlogger.log("this is second write");
// do some stuff
testlogger.log("this is third write");
// want to get logfile location on the run?
console.log(testlogger.logfile);
// done with everything?
// make sure to do this
testlogger.end();
```## API
### logto(options)
```
options = {
dir: String
file: String
mute: Boolean
}
```
`options.dir`: directory where log file needs to be saved, (if dir entered doesn't exists then logto creates one)
`options.file`: name of log file
`options.mute`:(default: true)if one wants to log into file as well as print the data on the screen then set mute: false