PHPackages                             kcmerrill/snitchin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kcmerrill/snitchin

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kcmerrill/snitchin
==================

An snitcher of things

024PHP

Since Jul 3Pushed 10y agoCompare

[ Source](https://github.com/kcmerrill/snitchin)[ Packagist](https://packagist.org/packages/kcmerrill/snitchin)[ RSS](/packages/kcmerrill-snitchin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Snitchin Out of the box, snitchin is a simple logger. However, it's purpose is much more than just this as I like to think of it as an emitter of sorts. Files, emails, slack channels, HTTP get/put requests and whatever else you can think of.

Before we dive into the specifics, lets first go over some terms.

\###Glossary **Snitcher** - In short, it's a way to store information to a file, a curl request, an email, a slack channel, to the console or wherever else you can imagine putting this information. A callback that takes 2 parameters. The first being $log\_entry which is an array that consists of a few basic values such as the timestamp, the message, the level and level text and a few others. The second being $options which is comprised of a mixed array needed to get the snitch up and running. An example for options would be a string of a filepath to save information to. Another quick example would be the slack channel url to post snitches.

**Level** - An integer value(presets are given) that you can customize that will determine if a snitch is to be called. Presets include the following:

- *fatal*: 60
- *error*: 50
- *warn*: 40
- *info*: 30
- *debug*: 20
- *trace*: 10

You can create new levels by using the levels() method. By default, if you create a new level without a numerical value, 61 will be assigned. The default emitter level is 60, meaning any custom levels you create will automatically be emitted.

**Channels** - A way to seperate different emitted events. You get a "default" channel out of the box, and you can create as many channels as needed. Some channels that might be of interest in creating: 'test','security','appspecific' etc ...

\#Installation The easiest way is to use composer and packagist. The package name is "kcmerrill/snitchin"

\#A quick but comprehensive demo

```
