kdabrow/log-level

Enum for severity level indicator in php

v1.0.0 2022-06-22 07:34 UTC

This package is auto-updated.

Last update: 2024-10-30 01:43:02 UTC


README

Enum for severity level indicator in php according to RFC 5424

Installation

composer require kdabrow/log-level

Usage

Methods

toLower

Prints lower case log name

<?php

use Kdabrow\LogLevel\Level;

echo Level::ERROR->toLower(); // prints: error

Examples

Compare by lower name

<?php

use Kdabrow\LogLevel\Level;

if (Level::INFO->toLower() == 'info') {
    echo "is info level log";
}

Compare by numeric value

<?php

use Kdabrow\LogLevel\Level;

if (Level::INFO == 6) {
    echo "is info level log";
}