Asf_Log_AbstractLogger::emergency

输出日志级别是 emergency


Description

public bool emergency(string $data, array $context = array())

Parameters

data

数据源, 大括号成对的内容,会被context替换

context

标签替换, 类似PHP函数 strtr, 但这里只支持数组

Return Values

日志写入成功返回 true, 否则返回 false

Examples

Example #1

<?php
define('LOG_PATH', '/data/logs/');
$logger = new Asf_Log_Adapter_File('biz-dd_log', LOG_PATH);

var_dump($logger->emergency(json_encode(array('a', 'b', 'c' => 123))));
var_dump($logger->emergency('xxxxx'));

Example #2

<?php
define('LOG_PATH', '/www/logs/')
$logger = new Asf_Log_Adapter_File('biz-dd_log', LOG_PATH);

var_dump($logger->emergency('xxxx{xy}y{yz}zz', array('xy' => 'AA', 'yz' => 'MM')));