Skip to content

Commit

Permalink
update to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeke committed Jun 30, 2015
1 parent 9b7b935 commit 40b7031
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
33 changes: 26 additions & 7 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2015-06-29</date>
<time>11:00:00</time>
<date>2015-06-30</date>
<time>14:05:00</time>
<version>
<release>1.2.0</release>
<api>1.2.0</api>
<release>1.2.2</release>
<api>1.2.2</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
- Fixed SeasLog::analyzerDetail() function compatible with MAC
- Fixed memory leak
- Support windows
- Fixed Logger bug with PHP-Version -ge 5.4
- Fixed SeasLog::log('level','message','content',['logger']) bug
- Support SeasLog::analyzerDetail("all")
- Support SeasLog::analyzerCount("all")
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -197,5 +198,23 @@
- Fixed SeasLog::analyzerDetail() function compatible with CentOS
</notes>
</release>
<release>
<date>2015-06-29</date>
<time>11:00:00</time>
<version>
<release>1.2.0</release>
<api>1.2.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
- Fixed SeasLog::analyzerDetail() function compatible with MAC
- Fixed memory leak
- Support windows
</notes>
</release>
</changelog>
</package>
16 changes: 7 additions & 9 deletions seaslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,13 @@ PHP_METHOD(SEASLOG_RES_NAME, getBuffer)
PHP_METHOD(SEASLOG_RES_NAME, log)
{
int argc = ZEND_NUM_ARGS();
char *message, *level = NULL;
int message_len, level_len;
char *message, *level = NULL, *logger = NULL;
int message_len = 0, level_len = 0, logger_len = 0;
zval **content;
zval *logger;

seaslog_init_buffer(TSRMLS_C);

if (zend_parse_parameters(argc TSRMLS_CC, "ss|Zs", &level, &level_len, &message, &message_len, &content, &logger) == FAILURE)
if (zend_parse_parameters(argc TSRMLS_CC, "ss|Zs", &level, &level_len, &message, &message_len, &content, &logger, &logger_len) == FAILURE)
return;

if (argc > 2 && Z_TYPE_PP(content) != IS_ARRAY) {
Expand All @@ -807,18 +806,15 @@ PHP_METHOD(SEASLOG_RES_NAME, log)
}

if (argc > 2) {
if (_seaslog_log_content(argc, level, message, message_len, HASH_OF(*content), Z_STRVAL_P(logger), Z_STRLEN_P(logger), seaslog_ce TSRMLS_CC) == FAILURE) {
zval_ptr_dtor(&logger);
if (_seaslog_log_content(argc, level, message, message_len, HASH_OF(*content), logger, logger_len, seaslog_ce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
} else {
if (_seaslog_log(argc, level, message, message_len, Z_STRVAL_P(logger), Z_STRLEN_P(logger), seaslog_ce TSRMLS_CC) == FAILURE) {
zval_ptr_dtor(&logger);
if (_seaslog_log(argc, level, message, message_len, logger, logger_len, seaslog_ce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
}

zval_ptr_dtor(&logger);
RETURN_TRUE;
}

Expand Down Expand Up @@ -975,8 +971,10 @@ int _seaslog_log_content(int argc, char *level, char *message, int message_len,
{
int ret;
char *result = php_strtr_array(message, message_len, content);

ret = _seaslog_log(argc, level, result, strlen(result), module, module_len, ce TSRMLS_CC);
efree(result);

return ret;
}

Expand Down

0 comments on commit 40b7031

Please sign in to comment.