Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav5-5 committed Nov 5, 2023
1 parent d007229 commit a816c93
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,47 @@
maplewood is a Python Library for creating logfiles in Plain Text(.txt) Format

## Compatibility
PyLogger has been tested to work on Windows, but should work on Linux and MacOS as well

## Installing
maplewood has been tested to work on Windows, but should work on Linux and MacOS as well

## Installing

maplewood can be installed using pip or any PyPI package managers
```sh
pip install maplewood
```

## Usage

```python
# import the chainsaw module
# containing the 'Chainsaw' class
from maplewood import chainsaw as cs

# creates a log.txt file in ./logs/
example_log = cs.Chainsaw()

# To log an event, we open the file first
example_log.open()

# To write to the log file
example_log.write(success=True, message="Example Task Executed")
# OR
# if we define a default success or failure message
example_log.update(success="Example success",
failure="Example Failure",
module="example")
example.log(False) # writes default fail state
example.log(True) # writes default pass state

# we can close the file if needed
example_log.close()
# and reopen
example_log.open()

# to check if log file is open
example_log.is_open() # -> bool

# remember to close the file
example_log.close()
```

0 comments on commit a816c93

Please sign in to comment.