Overview

Namespaces

  • Kotchasan
    • Cache
    • Database
    • Http
    • Log
    • Orm
  • None
  • PHP
  • Psr
    • Cache
    • Http
      • Message
    • Log

Classes

  • ArrayIterator
  • DateInterval
  • DOMNode
  • Kotchasan
  • Kotchasan\Accordion
  • Kotchasan\ApiController
  • Kotchasan\ArrayTool
  • Kotchasan\Cache\ApcCache
  • Kotchasan\Cache\Cache
  • Kotchasan\Cache\CacheItem
  • Kotchasan\Cache\FileCache
  • Kotchasan\CKEditor
  • Kotchasan\Collection
  • Kotchasan\Config
  • Kotchasan\Controller
  • Kotchasan\Country
  • Kotchasan\Csv
  • Kotchasan\Curl
  • Kotchasan\Currency
  • Kotchasan\Database
  • Kotchasan\Database\Db
  • Kotchasan\Database\DbCache
  • Kotchasan\Database\Driver
  • Kotchasan\Database\PdoMysqlDriver
  • Kotchasan\Database\Query
  • Kotchasan\Database\QueryBuilder
  • Kotchasan\Database\Schema
  • Kotchasan\Database\Sql
  • Kotchasan\DataTable
  • Kotchasan\Date
  • Kotchasan\DOMNode
  • Kotchasan\DOMParser
  • Kotchasan\Email
  • Kotchasan\File
  • Kotchasan\Files
  • Kotchasan\Form
  • Kotchasan\Grid
  • Kotchasan\Html
  • Kotchasan\Htmldoc
  • Kotchasan\HtmlTable
  • Kotchasan\Http\AbstractMessage
  • Kotchasan\Http\AbstractRequest
  • Kotchasan\Http\Message
  • Kotchasan\Http\NotFound
  • Kotchasan\Http\Request
  • Kotchasan\Http\Response
  • Kotchasan\Http\Stream
  • Kotchasan\Http\UploadedFile
  • Kotchasan\Http\Uri
  • Kotchasan\Image
  • Kotchasan\InputItem
  • Kotchasan\Inputs
  • Kotchasan\KBase
  • Kotchasan\Language
  • Kotchasan\ListItem
  • Kotchasan\Log\AbstractLogger
  • Kotchasan\Log\Logger
  • Kotchasan\Login
  • Kotchasan\Menu
  • Kotchasan\Mime
  • Kotchasan\Model
  • Kotchasan\Number
  • Kotchasan\ObjectTool
  • Kotchasan\Orm\Field
  • Kotchasan\Orm\Recordset
  • Kotchasan\Password
  • Kotchasan\Pdf
  • Kotchasan\Province
  • Kotchasan\Router
  • Kotchasan\Session
  • Kotchasan\Singleton
  • Kotchasan\Tab
  • Kotchasan\TableRow
  • Kotchasan\Template
  • Kotchasan\Text
  • Kotchasan\Validator
  • Kotchasan\View
  • PHPMailer
  • Psr\Log\AbstractLogger
  • Psr\Log\LogLevel
  • Psr\Log\NullLogger
  • SMTP

Interfaces

  • ArrayAccess
  • Countable
  • DateTimeInterface
  • Iterator
  • IteratorAggregate
  • Psr\Cache\CacheItemInterface
  • Psr\Cache\CacheItemPoolInterface
  • Psr\Http\Message\MessageInterface
  • Psr\Http\Message\RequestInterface
  • Psr\Http\Message\ResponseInterface
  • Psr\Http\Message\ServerRequestInterface
  • Psr\Http\Message\StreamInterface
  • Psr\Http\Message\UploadedFileInterface
  • Psr\Http\Message\UriInterface
  • Psr\Log\LoggerAwareInterface
  • Psr\Log\LoggerInterface
  • SeekableIterator
  • Serializable
  • Traversable

Traits

  • Psr\Log\LoggerTrait

Exceptions

  • Exception
  • InvalidArgumentException
  • Kotchasan\ApiException
  • Kotchasan\Cache\Exception
  • Kotchasan\Database\Exception
  • Kotchasan\InputItemException
  • LogicException
  • phpmailerException
  • RuntimeException

Functions

  • createClass
  • debug
  • getClassPath
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * @filesource Kotchasan/Log/AbstractLogger.php
  4:  *
  5:  * @copyright 2016 Goragod.com
  6:  * @license http://www.kotchasan.com/license/
  7:  *
  8:  * @see http://www.kotchasan.com/
  9:  */
 10: 
 11: namespace Kotchasan\Log;
 12: 
 13: use Psr\Log\LogLevel;
 14: 
 15: /**
 16:  * Kotchasan Logger Class (PSR-3).
 17:  *
 18:  * @author Goragod Wiriya <admin@goragod.com>
 19:  *
 20:  * @since 1.0
 21:  */
 22: abstract class AbstractLogger
 23: {
 24:     /**
 25:      * Action must be taken immediately.
 26:      *
 27:      * Example: Entire website down, database unavailable, etc. This should
 28:      * trigger the SMS alerts and wake you up.
 29:      *
 30:      * @param string $message
 31:      * @param array  $context
 32:      */
 33:     public function alert($message, array $context = array())
 34:     {
 35:         $this->log(LogLevel::ALERT, $message, $context);
 36:     }
 37: 
 38:     /**
 39:      * Critical conditions.
 40:      *
 41:      * Example: Application component unavailable, unexpected exception.
 42:      *
 43:      * @param string $message
 44:      * @param array  $context
 45:      */
 46:     public function critical($message, array $context = array())
 47:     {
 48:         $this->log(LogLevel::CRITICAL, $message, $context);
 49:     }
 50: 
 51:     /**
 52:      * Detailed debug information.
 53:      *
 54:      * @param string $message
 55:      * @param array  $context
 56:      */
 57:     public function debug($message, array $context = array())
 58:     {
 59:         $this->log(LogLevel::DEBUG, $message, $context);
 60:     }
 61: 
 62:     /**
 63:      * System is unusable.
 64:      *
 65:      * @param string $message
 66:      * @param array  $context
 67:      */
 68:     public function emergency($message, array $context = array())
 69:     {
 70:         $this->log(LogLevel::EMERGENCY, $message, $context);
 71:     }
 72: 
 73:     /**
 74:      * Runtime errors that do not require immediate action but should typically
 75:      * be logged and monitored.
 76:      *
 77:      * @param string $message
 78:      * @param array  $context
 79:      */
 80:     public function error($message, array $context = array())
 81:     {
 82:         $this->log(LogLevel::ERROR, $message, $context);
 83:     }
 84: 
 85:     /**
 86:      * Interesting events.
 87:      *
 88:      * Example: User logs in, SQL logs.
 89:      *
 90:      * @param string $message
 91:      * @param array  $context
 92:      */
 93:     public function info($message, array $context = array())
 94:     {
 95:         $this->log(LogLevel::INFO, $message, $context);
 96:     }
 97: 
 98:     /**
 99:      * Logs with an arbitrary level.
100:      *
101:      * @param mixed  $level
102:      * @param string $message
103:      * @param array  $context
104:      */
105:     abstract public function log($level, $message, array $context = array());
106: 
107:     /**
108:      * Normal but significant events.
109:      *
110:      * @param string $message
111:      * @param array  $context
112:      */
113:     public function notice($message, array $context = array())
114:     {
115:         $this->log(LogLevel::NOTICE, $message, $context);
116:     }
117: 
118:     /**
119:      * Exceptional occurrences that are not errors.
120:      *
121:      * Example: Use of deprecated APIs, poor use of an API, undesirable things
122:      * that are not necessarily wrong.
123:      *
124:      * @param string $message
125:      * @param array  $context
126:      */
127:     public function warning($message, array $context = array())
128:     {
129:         $this->log(LogLevel::WARNING, $message, $context);
130:     }
131: }
132: 
Kotchasan API documentation generated by ApiGen