Last active
July 13, 2018 06:00
-
-
Save otakustay/d467cec3dce2031f856a7aeb5711a02d to your computer and use it in GitHub Desktop.
Syntax highlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type": "comment", | |
"text": "/***************************************************************************" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * Copyright (c) 2009 Baidu.com, Inc. All Rights Reserved" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * $Id: basiclogadapter.cpp,v 1.4 2009/09/18 11:02:57 sun_xiao Exp $ " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " **************************************************************************/" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": "/**" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * @file basiclogadapter.cpp" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * @author yingxiang(com@baidu.com)" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * @date 2009/03/05 16:46:49" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * @version $Revision: 1.4 $ " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * @brief " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " * " | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": " **/" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "#", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "meta-keyword", | |
"text": "include", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "meta-string", | |
"text": "\"basiclogadapter.h\"", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "#", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "meta-keyword", | |
"text": "include", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "meta-string", | |
"text": "\"ul_log.h\"", | |
"scope": [ | |
"meta" | |
] | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": "//来自ullib" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "extern", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "keyword", | |
"text": "int", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "title", | |
"text": "ul_writelog_args", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": "(", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "keyword", | |
"text": "const", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "keyword", | |
"text": "int", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " event, ", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "keyword", | |
"text": "const", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": " ", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "keyword", | |
"text": "char", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": "* fmt, va_list args)", | |
"scope": [ | |
"function", | |
"params" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: _instance = " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "pthread_mutex_t" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: _lock = PTHREAD_MUTEX_INITIALIZER;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "BasicLogAdapter :: BasicLogAdapter(){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t_cate = " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t_level = " | |
}, | |
{ | |
"type": "number", | |
"text": "16" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: setCategory(comspace::Category * cate){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t_cate = cate;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "comspace :: Category * BasicLogAdapter :: tryCategory(){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(_cate == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(! comspace :: is_init_log()){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t\tcomspace :: init_log();" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\tcomspace :: " | |
}, | |
{ | |
"type": "text", | |
"text": "xAutoLock ", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "title", | |
"text": "autolock", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "params", | |
"text": "(&_lock)", | |
"scope": [ | |
"function" | |
] | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " buf[" | |
}, | |
{ | |
"type": "number", | |
"text": "128" | |
}, | |
{ | |
"type": "text", | |
"text": "];" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "built_in", | |
"text": "snprintf" | |
}, | |
{ | |
"type": "text", | |
"text": "(buf, " | |
}, | |
{ | |
"type": "keyword", | |
"text": "sizeof" | |
}, | |
{ | |
"type": "text", | |
"text": "(buf), " | |
}, | |
{ | |
"type": "string", | |
"text": "\"BasicLogAdapter%d\"" | |
}, | |
{ | |
"type": "text", | |
"text": ", _instance);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t++_instance;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t_cate = comspace::Category::getInstance(buf);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(_cate == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\tul_writelog(UL_LOG_WARNING, " | |
}, | |
{ | |
"type": "string", | |
"text": "\"No available category!\"" | |
}, | |
{ | |
"type": "text", | |
"text": ");" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " _cate;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: setDevice(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "com_device_t" | |
}, | |
{ | |
"type": "text", | |
"text": " * dev, " | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " num){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(dev == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\tul_writelog(UL_LOG_WARNING, " | |
}, | |
{ | |
"type": "string", | |
"text": "\"setDevice : dev = NULL\"" | |
}, | |
{ | |
"type": "text", | |
"text": ");" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "-1" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(tryCategory() == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "-1" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tcomspace::Appender * app = " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " cnt = " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "for" | |
}, | |
{ | |
"type": "text", | |
"text": "(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " i = " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": "; i < num; ++i){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\tapp = comspace::AppenderFactory::tryAppender(dev[i]);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(app == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t\tapp = comspace::AppenderFactory::getAppender(dev[i]);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(app != " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "( _cate->addAppender(app) == " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": " ){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t\t\t++cnt;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " cnt;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: setLogStat(comspace::LogStat * logstat){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(tryCategory() == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "-1" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " _cate->setLogStat(logstat);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: setLevel(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " level){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t_level = level;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: getLevel()" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "{" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " _level;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: write_args(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " level, " | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, va_list args){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(level < " | |
}, | |
{ | |
"type": "number", | |
"text": "32" | |
}, | |
{ | |
"type": "text", | |
"text": " && level > _level){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "number", | |
"text": "0" | |
}, | |
{ | |
"type": "text", | |
"text": ";" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "if" | |
}, | |
{ | |
"type": "text", | |
"text": "(_cate == " | |
}, | |
{ | |
"type": "literal", | |
"text": "NULL" | |
}, | |
{ | |
"type": "text", | |
"text": "){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ul_writelog_args(level, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "else" | |
}, | |
{ | |
"type": "text", | |
"text": "{" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " _cate->print(level, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: write(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " level, " | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(level, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: write(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * level, " | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " logid = comspace :: getLogId(level);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(logid, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: fatal(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(UL_LOG_FATAL, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: warning(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(UL_LOG_WARNING, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: notice(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(UL_LOG_NOTICE, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: trace(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(UL_LOG_TRACE, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " BasicLogAdapter :: debug(" | |
}, | |
{ | |
"type": "keyword", | |
"text": "const" | |
}, | |
{ | |
"type": "text", | |
"text": " " | |
}, | |
{ | |
"type": "keyword", | |
"text": "char" | |
}, | |
{ | |
"type": "text", | |
"text": " * fmt, ...){" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_list args;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_start(args, fmt);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "int" | |
}, | |
{ | |
"type": "text", | |
"text": " ret = write_args(UL_LOG_DEBUG, fmt, args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\tva_end(args);" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "\t" | |
}, | |
{ | |
"type": "keyword", | |
"text": "return" | |
}, | |
{ | |
"type": "text", | |
"text": " ret;" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "text", | |
"text": "}" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "lineBreak" | |
}, | |
{ | |
"type": "comment", | |
"text": "/* vim: set ts=4 sw=4 sts=4 tw=100 */" | |
}, | |
{ | |
"type": "lineBreak" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment