Metadata-Version: 2.4
Name: smlog
Version: 1.0.0
Summary: A simple Python logger with colors and file output
Author: Nikita Oleynik
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# smlog

A simple Python logger with colored console output, optional file logging, and daily log rotation.

## Features

- Colored console output for different log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Optional logging to files with automatic directory creation
- Daily log rotation
- Minimal setup and easy-to-use interface
- Customizable minimum log level

### Installation

```bash
pip install smlog
```

#### Create a logger

``` bash
from smlog import Logger

logger = Logger(
    name="user",
    min_level="INFO",
    use_colors=True,
    log_to_file=True,
    log_dir="logs",
    rotate_daily=True
)
```

#### Example

``` bash
from smlog import Logger

logger = Logger(
    name="user",
    min_level="INFO",
    use_colors=True,
    log_to_file=True,
    log_dir="logs",
    rotate_daily=True
)

logger.log("info", "Server has been started")
or
logger.info("Server has been started")
```

# Log messages of different levels

``` bash
- logger.debug("This is a debug message") # Will not be shown if min_level is INFO

- logger.info("This is an info message")

- logger.warning("This is a warning")

- logger.error("This is an error")
```

# Logging to File

``` bash
Logs are saved to the specified log_dir

File names are either log.log or daily rotated (YYYY-MM-DD.log)

Each log entry is separated for clarity:
[2026-01-25 23:45:12] [WARNING] [user] message
```
