Skip to content

Commit

Permalink
Add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtasvoboda committed Feb 22, 2016
1 parent 74c8450 commit c12462c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
55 changes: 28 additions & 27 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ class Plugin extends PluginBase
public function pluginDetails()
{
return [
'name' => 'vojtasvoboda.errorlogger::lang.plugin.name',
'name' => 'vojtasvoboda.errorlogger::lang.plugin.name',
'description' => 'vojtasvoboda.errorlogger::lang.plugin.description',
'author' => 'Vojta Svoboda',
'icon' => 'icon-bug',
'author' => 'Vojta Svoboda',
'icon' => 'icon-bug',
];
}

public function registerSettings()
{
return [
'config' => [
'label' => 'vojtasvoboda.errorlogger::lang.settings.label',
'category' => 'system::lang.system.categories.system',
'icon' => 'icon-bug',
'label' => 'vojtasvoboda.errorlogger::lang.settings.label',
'category' => 'system::lang.system.categories.system',
'icon' => 'icon-bug',
'description' => 'vojtasvoboda.errorlogger::lang.settings.description',
'class' => 'VojtaSvoboda\ErrorLogger\Models\Settings',
'class' => 'VojtaSvoboda\ErrorLogger\Models\Settings',
'permissions' => ['vojtasvoboda.errorlogger.*'],
'order' => 610,
'order' => 610,
]
];
}
Expand All @@ -52,7 +52,7 @@ public function registerPermissions()
{
return [
'vojtasvoboda.errorlogger.*' => [
'tab' => 'vojtasvoboda.errorlogger::lang.permissions.tab',
'tab' => 'vojtasvoboda.errorlogger::lang.permissions.tab',
'label' => 'vojtasvoboda.errorlogger::lang.permissions.all.label'
]
];
Expand All @@ -73,6 +73,10 @@ public function boot()

/**
* Set native mailer handler
*
* Formatting lines example (use before pushHandler()):
* $formater = new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n");
* $handler->setFormatter($formater);
*
* @param $monolog
*
Expand All @@ -91,15 +95,11 @@ private function setNativeMailerHandler($monolog)
return $monolog;
}

$email = Settings::get('nativemailer_email');
$email = Settings::get('nativemailer_email');
$subject = Config::get('app.url') . ' - error report';
$from = Config::get('mail.from.address');
$level = Settings::get('nativemailer_level', 100);
$from = Config::get('mail.from.address');
$level = Settings::get('nativemailer_level', 100);
$handler = new NativeMailerHandler($email, $subject, $from, $level);
/*
$formater = new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n");
$handler->setFormatter($formater);
*/
$monolog->pushHandler($handler);

return $monolog;
Expand All @@ -119,12 +119,12 @@ private function setSlackHandler($monolog)
return $monolog;
}

$token = Settings::get('slack_token');
$channel = Settings::get('slack_channel', 'random');
$username = Settings::get('slack_username', 'error-bot');
$token = Settings::get('slack_token');
$channel = Settings::get('slack_channel', 'random');
$username = Settings::get('slack_username', 'error-bot');
$attachment = Settings::get('slack_attachment', false);
$level = Settings::get('slack_level', 100);
$handler = new SlackHandler($token, $channel, $username, $attachment, null, $level);
$level = Settings::get('slack_level', 100);
$handler = new SlackHandler($token, $channel, $username, $attachment, null, $level);
$monolog->pushHandler($handler);

return $monolog;
Expand All @@ -144,10 +144,10 @@ private function setSyslogHandler($monolog)
return $monolog;
}

$ident = Settings::get('syslog_ident');
$ident = Settings::get('syslog_ident');
$facility = Settings::get('syslog_facility');
$level = Settings::get('syslog_level', 100);
$handler = new SyslogHandler($ident, $facility, $level);
$level = Settings::get('syslog_level', 100);
$handler = new SyslogHandler($ident, $facility, $level);
$monolog->pushHandler($handler);

return $monolog;
Expand All @@ -167,9 +167,10 @@ private function setNewrelicHandler($monolog)
return $monolog;
}

$appname = Settings::get('newrelic_appname');
$level = Settings::get('newrelic_level', 100);
$handler = new NewRelicHandler($level, $bubble = true, $appname);
$appname = Settings::get('newrelic_appname');
$level = Settings::get('newrelic_level', 100);
$bubble = true;
$handler = new NewRelicHandler($level, $bubble, $appname);
$monolog->pushHandler($handler);

return $monolog;
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Error Logger plugin for OctoberCMS

[![Codacy](https://img.shields.io/codacy/fd21835023b6413ca9a71815362ee22a.svg)](https://www.codacy.com/app/vojtasvoboda/oc-errorlogger-plugin)
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/g/vojtasvoboda/oc-errorlogger-plugin.svg)](https://scrutinizer-ci.com/g/vojtasvoboda/oc-errorlogger-plugin/?branch=master)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vojtasvoboda/oc-errorlogger-plugin/blob/master/LICENSE.md)

Immediately sends an error from your OctoberCMS application to email, HipChat, Mandrill, NewRelic, Slack, Syslog, and more!

- no plugin dependencies
Expand All @@ -21,10 +25,10 @@ _Waiting for implementation:_ CouchDB, Cube, ElasticSearch, FirePHP, Flowdock, H

**Feel free to send pullrequest!**

## License
## Contributing

Error logger plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) same as OctoberCMS platform.
Please send Pull Request to master branch.

## Contributing
## License

Please send Pull Request to master branch.
Error logger plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) same as OctoberCMS platform.

0 comments on commit c12462c

Please sign in to comment.