Download the PHP package sharkydog/logger without Composer

On this page you can find all versions of the php package sharkydog/logger. 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 logger

logger

Simple static logger.

The main purpose of this package is to provide simple logging/debugging from any scope. The logger can be easily filtered, adjusted or switched off.

Logging backends and message formatting are TBD and for now everything is printed on stdout. That might change, but the public api will not without a major version bump.

Currently messages look like this:

Usage

Messages are sent to the logger through several static methods that represent different logging levels. These are (low to high): error, warning, info, debug, destruct, memory.

First four have the same signature:

Prefix (time,level) and suffix (tags) are added to the message after it is filtered and before being printed. Tags are arbitrary strings that can be used to filter out (or in) messages.

Destruct and memory levels are special, they are higher than debug (think verbose) and have different signatures:

Destruct logs when objects are being destroyed, in three ways.

Memory level logs memory_get_usage() and memory_get_peak_usage(). In the message:

P: is the peak memory, R: is real memory (memory_get_usage(true)), (+ 495.39K) is the change from previous memory log. If $real is true, only real usage is logged.

Adjust log level

Logging level is set with:

Level constants are available:

Default is Logger::WARNING, only errors and warnings.

This will set the level to debug and everything will be logged, except destruct and memory messages.

Filters

Filters are callbacks executed on every message, they are added with:

Filters can be added for a specific level or for all (Logger::ALL). They should follow the signature:

Filters are called in order they were added. Returning boolean false will stop processing the message, no more filters will be executed and the message is discarded. You can do whatever you like with the message (and tags) before returning false, like save it to a file or dump it to a proper logger. A message will reach filters only if the level is set to accept it.


All versions of logger with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 sharkydog/logger contains the following files

Loading the files please wait ....