Download the PHP package vaibhavpandeyvpz/drishti without Composer

On this page you can find all versions of the php package vaibhavpandeyvpz/drishti. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drishti

Drishti

Latest Version Downloads PHP Version Build Status

A lightweight, flexible PSR-3 compliant logging library with configurable backends, PSR-20 Clock support, and minimal dependencies.

Drishti (दृष्टि) - Sanskrit for "Vision" or "Sight", representing the ability to see and record what happens in your application.

Features

Installation

Install via Composer:

Quick Start

Usage

Basic Logging

The Logger class implements the PSR-3 LoggerInterface and provides methods for all standard log levels:

Message Interpolation

Drishti supports PSR-3 message interpolation using placeholders in the form {key}:

Context Data Types

The logger handles various context data types:

Exception Logging

When an exception is included in the context with the key exception, Drishti automatically appends exception details:

Using the log() Method

You can also use the generic log() method with any valid PSR-3 log level:

Stringable Messages

Messages can be strings or objects implementing \Stringable:

Backend System

Drishti uses a contract-based backend system that allows you to configure where logs are written. You can use one or more backends simultaneously.

Default Behavior

If no backends are configured, Drishti uses default behavior:

Using Backends

Configure backends when creating the logger:

Available Backends

StdioBackend

Writes logs to standard I/O streams (STDOUT or STDERR). Use static factory methods to create instances:

FileBackend

Writes logs to a single file. The directory will be created automatically if it doesn't exist:

DailyFileBackend

Writes logs to daily rotating files (logrotate style). Files are named with the date suffix:

Custom Backends

Create your own backend by implementing BackendInterface:

Multiple Backends

Send logs to multiple destinations simultaneously:

Formatters

Drishti includes two first-party formatters and supports custom formatters.

SimpleLogEntryFormatter (Default)

The default formatter produces human-readable log entries:

Output format: [2024-01-15 10:30:45] INFO: User logged in

JsonLogEntryFormatter

For structured logging, use the JSON formatter:

Output format:

The JSON formatter includes:

Custom Formatters

You can create custom formatters by implementing LogEntryFormatterInterface:

PSR-20 Clock Support

Drishti uses PSR-20 ClockInterface for all time operations, making it testable and flexible. All backends and formatters accept an optional ClockInterface instance.

For testing, you can use a frozen clock like samay:

Output Format

All log entries include a timestamp in the format [YYYY-MM-DD HH:MM:SS].

Example output:

Requirements

For testing, we recommend samay for frozen clocks:

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or contributions, please visit the GitHub repository.


All versions of drishti with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/clock Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vaibhavpandeyvpz/drishti contains the following files

Loading the files please wait ...