Coder Social home page Coder Social logo

effectra / log Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 4 KB

Effectra\Log is a logging library that provides a simple and flexible way to handle logging in your PHP applications. It implements the PSR-3 LoggerInterface and includes additional features for log handling.

PHP 100.00%
log logging php psr psr-3

log's Introduction

Effectra\Log

Effectra\Log is a logging library that provides a simple and flexible way to handle logging in your PHP applications. It implements the PSR-3 LoggerInterface and includes additional features for log handling.

Installation

You can install the Effectra\Log library via Composer. Run the following command in your project directory:

composer require effectra/log

Usage

To use the Effectra\Log library in your project, follow these steps:

  1. Create an instance of the Logger class:

    use Effectra\Log\Logger;
    
    $logger = new Logger('/path/to/log/file.log');
  2. Start logging messages:

    $logger->info('This is an informational message.');
    $logger->error('An error occurred.', ['context' => 'additional data']);
    // ...
  3. Customize log levels:

    use Effectra\Log\LogLevel;
    
    $logger->log(LogLevel::DEBUG, 'Debug message');
    $logger->log(LogLevel::WARNING, 'Warning message');
    // ...
  4. Set the logger instance on other classes (optional):

    use Effectra\Log\LoggerAware;
    use Psr\Log\LoggerInterface;
    
    class MyClass implements LoggerAware
    {
        public function __construct(LoggerInterface $logger)
        {
            $this->setLogger($logger);
        }
    
        // ...
    }

For more detailed information on the available methods and features, refer to the code documentation and the PSR-3 LoggerInterface documentation.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

The Effectra\Log library is open-source software released under the MIT License.

log's People

Contributors

bmtmohammedtaha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.