2017 © Pedro Peláez
 

library hipchat-logger

Simple logger class for HipChat

image

vysinsky/hipchat-logger

Simple logger class for HipChat

  • Thursday, September 18, 2014
  • by vysinsky
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,505 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

HipChat Logger

PSR-3 compatible logger class which will send you notification to your HipChat room., (*1)

Screenshot (taken with Nette Framework's Tracy bridge)

Screenshot, (*2)

Installation

Via composer require vysinsky/hipchat-logger:@dev, (*3)

Configuration

Class Vysinsky\HipChat\Logger has some static properties you can use to configure:, (*4)

  • notifyLevels - Array of levels for which notification (HipChat's popup) is enabled
  • colors - Basic colors setup based on log level. In case of unknown key yellow color will be used

Available bridges

Nette Framework (Tracy)

For Nette there is compiler extension. Just add it to your extensions list in neon configuration:, (*5)

hipChatLogger: Vysinsky\HipChat\Bridges\Tracy\DI\Extension

And add some configuration:, (*6)

hipChatLogger:
    accessToken: yourAccessToken
    roomName: test
    filters:
        - [LoggerFilter, filterAccess]
    linkFactory: [MyLinkFactory::createLink] # Set link factory

Other features

Filters

You can now easilly filter messages and decide, whether message should be sent. Filters are simple callbacks which get $level, $message and $context as parameter. Filter return boolean $shouldSend. As soon as any filter returns FALSE execution is stopped., (*7)

Example (we don't want to log 404s):, (*8)

class LoggerFilter 
{
    function filterAccess($level, $message, $context)
    {
        return $level !== 'access';
    }
}

You can set callback factory to Logger, which will create link to log file and send it in message if link is available., (*9)

You can set it with calling setLinkToLogFileFactory (only in Vysinsky\HipChat\Bridges\Tracy):, (*10)

$logger->setLinkToLogFileFactory(function(Vysinsky\HipChat\Bridges\Tracy $logger, $logPath){
    return $logger->extractLogPath($logPath);
});

The Versions

18/09 2014

dev-master

9999999-dev

Simple logger class for HipChat

  Sources   Download

MIT

The Requires

 

18/09 2014

1.1.2

1.1.2.0

Simple logger class for HipChat

  Sources   Download

MIT

The Requires

 

02/09 2014

1.1.1

1.1.1.0

Simple logger class for HipChat

  Sources   Download

MIT

The Requires

 

08/08 2014

1.1.0

1.1.0.0

Simple logger class for HipChat

  Sources   Download

MIT

The Requires

 

08/08 2014

1.0.1

1.0.1.0

Simple logger class for HipChat

  Sources   Download

MIT

The Requires

 

08/08 2014

1.0.0

1.0.0.0

Simple logger class for HipChat

  Sources   Download

MIT

The Requires