|
18 | 18 | */ |
19 | 19 | namespace Fluent\Logger; |
20 | 20 |
|
| 21 | +use Psr\Log\LogLevel; |
| 22 | + |
21 | 23 | /** |
22 | 24 | * Fluent Logger |
23 | 25 | * |
@@ -519,46 +521,46 @@ public function getOption($key, $default = null) |
519 | 521 |
|
520 | 522 | public function emergency($message, array $context = array()) |
521 | 523 | { |
522 | | - return $this->post($message, array_merge(array('level' => 'emergency'), $context)); |
| 524 | + return $this->post($message, array_merge(array('level' => LogLevel::EMERGENCY), $context)); |
523 | 525 | } |
524 | 526 |
|
525 | 527 | public function alert($message, array $context = array()) |
526 | 528 | { |
527 | | - return $this->post($message, array_merge(array('level' => 'alert'), $context)); |
| 529 | + return $this->post($message, array_merge(array('level' => LogLevel::ALERT), $context)); |
528 | 530 | } |
529 | 531 |
|
530 | 532 | public function critical($message, array $context = array()) |
531 | 533 | { |
532 | | - return $this->post($message, array_merge(array('level' => 'critical'), $context)); |
| 534 | + return $this->post($message, array_merge(array('level' => LogLevel::CRITICAL), $context)); |
533 | 535 | } |
534 | 536 |
|
535 | 537 | public function error($message, array $context = array()) |
536 | 538 | { |
537 | | - return $this->post($message, array_merge(array('level' => 'error'), $context)); |
| 539 | + return $this->post($message, array_merge(array('level' => LogLevel::ERROR), $context)); |
538 | 540 | } |
539 | 541 |
|
540 | 542 | public function warning($message, array $context = array()) |
541 | 543 | { |
542 | | - return $this->post($message, array_merge(array('level' => 'warning'), $context)); |
| 544 | + return $this->post($message, array_merge(array('level' => LogLevel::WARNING), $context)); |
543 | 545 | } |
544 | 546 |
|
545 | 547 | public function notice($message, array $context = array()) |
546 | 548 | { |
547 | | - return $this->post($message, array_merge(array('level' => 'notice'), $context)); |
| 549 | + return $this->post($message, array_merge(array('level' => LogLevel::NOTICE), $context)); |
548 | 550 | } |
549 | 551 |
|
550 | 552 | public function info($message, array $context = array()) |
551 | 553 | { |
552 | | - return $this->post($message, array_merge(array('level' => 'info'), $context)); |
| 554 | + return $this->post($message, array_merge(array('level' => LogLevel::INFO), $context)); |
553 | 555 | } |
554 | 556 |
|
555 | 557 | public function debug($message, array $context = array()) |
556 | 558 | { |
557 | | - return $this->post($message, array_merge(array('level' => 'debug'), $context)); |
| 559 | + return $this->post($message, array_merge(array('level' => LogLevel::DEBUG), $context)); |
558 | 560 | } |
559 | 561 |
|
560 | 562 | public function log($level, $message, array $context = array()) |
561 | 563 | { |
562 | | - return $this->post($message, array_merge(array('level' => 'log'), $context)); |
| 564 | + return $this->post($message, array_merge(array('level' => $level), $context)); |
563 | 565 | } |
564 | 566 | } |
0 commit comments