-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0edf84b
commit a8febf2
Showing
3 changed files
with
96 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace Rap2hpoutre\LaravelLogViewer; | ||
|
||
/** | ||
* Class Level | ||
* @package Rap2hpoutre\LaravelLogViewer | ||
*/ | ||
class Level | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $levels_classes = [ | ||
'debug' => 'info', | ||
'info' => 'info', | ||
'notice' => 'info', | ||
'warning' => 'warning', | ||
'error' => 'danger', | ||
'critical' => 'danger', | ||
'alert' => 'danger', | ||
'emergency' => 'danger', | ||
'processed' => 'info', | ||
'failed' => 'warning', | ||
]; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $levels_imgs = [ | ||
'debug' => 'info-circle', | ||
'info' => 'info-circle', | ||
'notice' => 'info-circle', | ||
'warning' => 'exclamation-triangle', | ||
'error' => 'exclamation-triangle', | ||
'critical' => 'exclamation-triangle', | ||
'alert' => 'exclamation-triangle', | ||
'emergency' => 'exclamation-triangle', | ||
'processed' => 'info-circle', | ||
'failed' => 'exclamation-triangle' | ||
]; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function all() | ||
{ | ||
return array_keys($this->levels_imgs); | ||
} | ||
|
||
/** | ||
* @param $level | ||
* @return string | ||
*/ | ||
public function img($level) | ||
{ | ||
return $this->levels_imgs[$level]; | ||
} | ||
|
||
/** | ||
* @param $level | ||
* @return string | ||
*/ | ||
public function cssClass($level) | ||
{ | ||
return $this->levels_classes[$level]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters