Skip to content

Commit d4fb1bc

Browse files
committed
Added loglevel const
1 parent c5d9320 commit d4fb1bc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/FluentLogger.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
namespace Fluent\Logger;
2020

21+
use Psr\Log\LogLevel;
22+
2123
/**
2224
* Fluent Logger
2325
*
@@ -519,46 +521,46 @@ public function getOption($key, $default = null)
519521

520522
public function emergency($message, array $context = array())
521523
{
522-
return $this->post($message, array_merge(array('level' => 'emergency'), $context));
524+
return $this->post($message, array_merge(array('level' => LogLevel::EMERGENCY), $context));
523525
}
524526

525527
public function alert($message, array $context = array())
526528
{
527-
return $this->post($message, array_merge(array('level' => 'alert'), $context));
529+
return $this->post($message, array_merge(array('level' => LogLevel::ALERT), $context));
528530
}
529531

530532
public function critical($message, array $context = array())
531533
{
532-
return $this->post($message, array_merge(array('level' => 'critical'), $context));
534+
return $this->post($message, array_merge(array('level' => LogLevel::CRITICAL), $context));
533535
}
534536

535537
public function error($message, array $context = array())
536538
{
537-
return $this->post($message, array_merge(array('level' => 'error'), $context));
539+
return $this->post($message, array_merge(array('level' => LogLevel::ERROR), $context));
538540
}
539541

540542
public function warning($message, array $context = array())
541543
{
542-
return $this->post($message, array_merge(array('level' => 'warning'), $context));
544+
return $this->post($message, array_merge(array('level' => LogLevel::WARNING), $context));
543545
}
544546

545547
public function notice($message, array $context = array())
546548
{
547-
return $this->post($message, array_merge(array('level' => 'notice'), $context));
549+
return $this->post($message, array_merge(array('level' => LogLevel::NOTICE), $context));
548550
}
549551

550552
public function info($message, array $context = array())
551553
{
552-
return $this->post($message, array_merge(array('level' => 'info'), $context));
554+
return $this->post($message, array_merge(array('level' => LogLevel::INFO), $context));
553555
}
554556

555557
public function debug($message, array $context = array())
556558
{
557-
return $this->post($message, array_merge(array('level' => 'debug'), $context));
559+
return $this->post($message, array_merge(array('level' => LogLevel::DEBUG), $context));
558560
}
559561

560562
public function log($level, $message, array $context = array())
561563
{
562-
return $this->post($message, array_merge(array('level' => 'log'), $context));
564+
return $this->post($message, array_merge(array('level' => $level), $context));
563565
}
564566
}

0 commit comments

Comments
 (0)