yast2-core
|
#include <string>
#include <stdio.h>
Go to the source code of this file.
Classes | |
class | LogTail |
Macros | |
#define | y2log_suffix |
#define | y2log_prefix "" |
#define | y2_logger(level, comp, file, line, function, format, args...) |
#define | y2_vlogger(level, comp, file, line, function, format, args) |
#define | y2logger(level, format, args...) y2_logger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,##args) |
#define | y2vlogger(level, format, ap) y2_vlogger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,ap) |
#define | y2debug(format, args...) y2logger(LOG_DEBUG,format,##args) |
#define | y2milestone(format, args...) y2logger(LOG_MILESTONE,format,##args) |
#define | y2warning(format, args...) y2logger(LOG_WARNING,format,##args) |
#define | y2error(format, args...) y2logger(LOG_ERROR,format,##args) |
#define | y2security(format, args...) y2logger(LOG_SECURITY,format,##args) |
#define | y2internal(format, args...) y2logger(LOG_INTERNAL,format,##args) |
#define | y2lograw(message) y2_logger_raw(message) |
Enumerations | |
enum | loglevel_t { LOG_DEBUG = 0, LOG_MILESTONE = 1, LOG_WARNING = 2, LOG_ERROR = 3, LOG_SECURITY = 4, LOG_INTERNAL = 5 } |
Functions | |
void | y2_logger_function (loglevel_t level, const string &component, const char *file, const int line, const char *func, const char *format,...) __attribute__((format(printf |
void void | y2_logger_blanik (loglevel_t level, const string &component, const char *file, const int line, const char *func, const char *format,...) __attribute__((format(printf |
void void void | y2_vlogger_function (loglevel_t level, const string &component, const char *file, const int line, const char *func, const char *format, va_list ap) |
void | y2_vlogger_blanik (loglevel_t level, const string &component, const char *file, const int line, const char *func, const char *format, va_list ap) |
void | y2_logger_raw (const char *message) |
bool | should_be_logged (int loglevel, const string &componentname) |
bool | should_be_buffered () |
void | set_log_filename (string filename) |
string | get_log_filename () |
void | set_log_conf (string confname) |
void | set_log_simple_mode (bool simple) |
void | set_log_debug (bool on=true) |
bool | get_log_debug () |
Variables | |
LogTail | blanik |
#define y2_logger | ( | level, | |
comp, | |||
file, | |||
line, | |||
function, | |||
format, | |||
args... | |||
) |
Referenced by Y2SLog::Y2Loglinebuf::writeout().
#define y2_vlogger | ( | level, | |
comp, | |||
file, | |||
line, | |||
function, | |||
format, | |||
args | |||
) |
Referenced by Y2Namespace::addSymbol(), Y2YCPFunction::appendParameter(), attach_parameter(), YBlock::attachEntry(), YETerm::attachParameter(), YEBuiltin::attachParameter(), YECall::attachParameter(), YBlock::attachStatement(), YEBuiltin::attachSymVariable(), Type::basematch(), YSTextdomain::bind(), YLocale::bindDomainDir(), YCPPathSearch::bytecodeForFile(), Type::canCast(), YEPropagate::canPropagate(), YCPDebugger::check_socket(), DummyAgent::checkPath(), YEBuiltin::closeParameters(), SymbolTable::closeXRefs(), YSBracket::commit(), Type::commontype(), ListType::commontype(), MapType::commontype(), Y2CCSCR::create(), Y2ComponentBroker::createComponent(), YBlock::createFunctionCall(), Y2CCWFM::createInLevel(), YCPDebugger::debug(), IniSection::delMyValue(), IniSection::delSection(), YBlock::detachEnvironment(), Type::detailedtype(), ListType::detailedtype(), MapType::detailedtype(), Type::determineFlexType(), IniSection::dirHelper(), Import::disableTracking(), SymbolTable::disableUsage(), Y2WFMComponent::doActualWork(), Y2ProgramComponent::doActualWork(), dump_value(), Import::enableTracking(), SymbolTable::enableUsage(), YBlock::endInclude(), SymbolTable::endUsage(), SymbolTable::enter(), Y2AgentComp< Agent >::evaluate(), YEVariable::evaluate(), YStatement::evaluate(), YCPCodeRep::evaluate(), YEReference::evaluate(), YSBreak::evaluate(), YETerm::evaluate(), YSContinue::evaluate(), YBreakpoint::evaluate(), YSExpression::evaluate(), YECompare::evaluate(), YSBlock::evaluate(), YBlock::evaluate(), YELocale::evaluate(), YSReturn::evaluate(), YEList::evaluate(), YSTypedef::evaluate(), YEMap::evaluate(), YSFunction::evaluate(), YEPropagate::evaluate(), YCode::evaluate(), YEUnary::evaluate(), YSAssign::evaluate(), YEBinary::evaluate(), YCPEntryRep::evaluate(), YConst::evaluate(), YSBracket::evaluate(), YETriple::evaluate(), YSIf::evaluate(), YEIs::evaluate(), YSWhile::evaluate(), YCPReferenceRep::evaluate(), YLocale::evaluate(), YSRepeat::evaluate(), YSDo::evaluate(), YEBuiltin::evaluate(), YFunction::evaluate(), YSImport::evaluate(), YEFunction::evaluate(), YEFunctionPointer::evaluate(), YSFilename::evaluate(), YSSwitch::evaluate(), Y2YCPFunction::evaluateCall(), YBlock::evaluateFrom(), ScriptingAgent::Execute(), ScriptingAgent::executeSubagentCommand(), file_stream(), fillCache(), YEBuiltin::finalize(), YECall::finalize(), YCPPathSearch::find(), StaticDeclaration::findDeclaration(), AnyAgent::findSyntax(), Y2PathSearch::findy2exe(), Y2PathSearch::findy2plugin(), Y2Namespace::finish(), FlexType::FlexType(), flushCache(), Type::fromSignature(), YCPMapRep::functionalAdd(), FunctionType::FunctionType(), ModulesConf::getArgument(), IniParser::getFileName(), AnyAgent::getLine(), IniSection::getMyValue(), Y2ComponentBroker::getNamespaceComponent(), ModulesConf::getOption(), Y2PathSearch::getPaths(), IniSection::getSectionProp(), IniSection::getValue(), i_check_binary_op(), i_check_compare_op(), i_check_unary_op(), TestY2Component::import(), Import::import(), Y2WFMComponent::import(), ScriptingAgent::InitRegDirs(), Scanner::initTables(), Y2ProgramComponent::launchExternalProgram(), YCPDebugger::list_source(), Y2PluginComponent::loadPlugin(), Y2PluginComponent::locateSym(), main(), TableEntry::makeDefinition(), Type::match(), FlexType::match(), NFlexType::match(), VariableType::match(), ListType::match(), MapType::match(), BlockType::match(), TupleType::match(), FunctionType::match(), FlexType::matchFlex(), NFlexType::matchFlex(), VariableType::matchFlex(), ListType::matchFlex(), MapType::matchFlex(), BlockType::matchFlex(), TupleType::matchFlex(), FunctionType::matchFlex(), Type::matchvalue(), ModulesConf::ModulesConf(), SCRSubAgent::mount(), Xmlcode::namespaceInit(), Bytecode::namespaceInit(), YBlock::newEntry(), YBlock::newNamespace(), YBlock::newValue(), NFlexType::NFlexType(), SymbolTable::openXRefs(), ResolverAgent::otherCommand(), AnyAgent::otherCommand(), Parser::parse(), IniParser::parse(), AnyAgent::parseChoice(), ScriptingAgent::parseConfigFiles(), AnyAgent::parseData(), ModulesConf::parseFile(), AnyAgent::parseFloat(), AnyAgent::parseList(), AnyAgent::parseSequence(), ScriptingAgent::parseSingleConfigFile(), AnyAgent::parseTuple(), Point::Point(), YaST::ExecutionEnvironment::popframe(), Xmlcode::popNamespace(), Bytecode::popNamespace(), Xmlcode::popUptoNamespace(), Bytecode::popUptoNamespace(), YBlock::pretachStatement(), program_stream(), TestY2CC::provideNamespace(), Y2CCSerial::provideNamespace(), Y2CCWFM::provideNamespace(), Y2CCProgram::provideNamespace(), Y2CCPlugin::provideNamespace(), YaST::ExecutionEnvironment::pushframe(), Xmlcode::pushNamespace(), Bytecode::pushNamespace(), ResolverAgent::Read(), ModulesAgent::Read(), ScriptingAgent::Read(), AnyAgent::Read(), SCRAgent::readconf(), StaticDeclaration::readDeclaration(), Bytecode::readEntry(), Xmlcode::readType(), Bytecode::readType(), Bytecode::readYCodelist(), Y2StdioComponent::receive(), recurseNext(), recurseStart(), ScriptingAgent::RegisterAgent(), StaticDeclaration::registerDeclarations(), remove_directory(), Scanner::Scanner(), SCR::SCR(), SCRDir(), SCRError(), SCRExecute(), SCRExecute2(), SCRExecute3(), ScriptingAgent::ScriptingAgent(), SCRRegisterAgentS(), SCRRegisterAgentT(), SCRRegisterNewAgents(), SCRUnmountAgent(), SCRUnregisterAgent(), SCRUnregisterAllAgents(), SCRWrite2(), SCRWrite3(), Y2StdioComponent::send(), Debugger::sendOutput(), Y2ProgramComponent::sendToExternal(), IniSection::setAll(), ModuleEntry::setArgument(), YCode::setCommentAfter(), YCode::setCommentBefore(), YFunction::setDefinition(), YBlock::setKind(), Y2WFMComponent::SetLanguage(), IniSection::setMyValue(), ModuleEntry::setOption(), ModuleEntry::setOptions(), IniSection::setSectionProp(), SymbolEntry::setValue(), IniSection::setValue(), YCPListRep::shallowCopy(), shellcommand(), stack_pop(), WFMSubAgent::start(), start_block(), SymbolTable::startUsage(), StaticDeclaration::StaticDeclaration(), ScriptingAgent::Sweep(), switch(), SystemAgent::SystemAgent(), YBlock::table(), YStatement::toStream(), Point::toStream(), YSymbolEntry::toStream(), YCPTermRep::toStream(), Type::toStream(), YCode::toStream(), YBlock::toStream(), YCPEntryRep::toStream(), NFlexType::toStream(), YFunction::toStream(), YSImport::toStream(), FunctionType::toStream(), YFunction::toStreamDefinition(), YSymbolEntry::toString(), SymbolEntry::toString(), YEMap::toString(), YECall::toString(), Point::toXml(), YCode::toXml(), ScriptingAgent::tryRegister(), TupleType::TupleType(), Type::Type(), YEBuiltin::type(), FlexType::unflex(), NFlexType::unflex(), VariableType::unflex(), ListType::unflex(), MapType::unflex(), BlockType::unflex(), TupleType::unflex(), FunctionType::unflex(), AnyAgent::unparseBoolean(), AnyAgent::unparseData(), AnyAgent::unparseFloat(), AnyAgent::unparseHexval(), AnyAgent::unparseHostname(), AnyAgent::unparseIp4Number(), AnyAgent::unparseList(), AnyAgent::unparseNumber(), AnyAgent::unparseSeparator(), AnyAgent::unparseString(), AnyAgent::unparseTuple(), AnyAgent::unparseUsername(), AnyAgent::unparseVerbose(), ScriptingAgent::UnregisterAgent(), IniParser::UpdateIfModif(), AnyAgent::validateCache(), SymbolEntry::value(), WFM::WFM(), while(), ResolverAgent::Write(), AnyAgent::Write(), IniParser::write(), StaticDeclaration::writeDeclaration(), ModulesConf::writeFile(), SymbolTable::writeUsage(), AnyAgent::writeValueByPath(), SymbolTable::writeXmlUsage(), Bytecode::writeYCodelist(), Y2LanguageLoader::Y2LanguageLoader(), Y2WFMComponent::Y2WFMComponent(), Y2YCPFunction::Y2YCPFunction(), YBlock::YBlock(), YConst::YConst(), YCPDebugger::YCPDebugger(), YEBuiltin::YEBuiltin(), YECall::YECall(), YEFunction::YEFunction(), YEFunctionPointer::YEFunctionPointer(), YEReference::YEReference(), YFunction::YFunction(), YSImport::YSImport(), YStatement::YStatement(), YSymbolEntry::YSymbolEntry(), yylex(), SymbolTable::~SymbolTable(), Y2Namespace::~Y2Namespace(), YBlock::~YBlock(), and YCPDebugger::~YCPDebugger().
Referenced by attach_comment(), attach_comment_after(), YBlock::attachEntry(), Y2YCPFunction::attachParameter(), bytecodeistream::bytecodeistream(), FileDescr::changed(), YCPDebugger::check_socket(), Y2WFMComponent::ClientExists(), SymbolTable::closeXRefs(), Regex_t::compile(), Regex::compile(), YCPDebugger::create_socket(), Y2CCProgram::createInLevel(), YaST::crypt_pass(), IniSection::Delete(), IniSection::delSection(), IniSection::delValue(), IniSection::Dir(), Y2WFMComponent::doActualWork(), YBlock::endInclude(), YaST::ExecutionEnvironment::endlessRecursion(), AnyAgent::evalArg(), Y2AgentComp< Agent >::evaluate(), Y2StdioComponent::evaluate(), Y2SerialComponent::evaluate(), Y2PluginComponent::evaluate(), Y2ProgramComponent::evaluate(), YCode::evaluate(), YEFunction::evaluate(), Scanner::extend_scanbuffer(), FileDescr::FileDescr(), fillCache(), YEFunction::finalize(), IniSection::findEndFromUp(), IniSection::findSection(), AnyAgent::findSyntax(), Y2YCPFunction::finishParameters(), flushCache(), Type::fromSignature(), AnyAgent::get_line(), IniSection::getAll(), IniBase::getMapInteger(), IniBase::getMapString(), ModulesConf::getModules(), ModulesConf::getOptions(), IniSection::getSection(), ModulesConf::getTimeStamp(), IniParser::getTimeStamp(), SymbolTable::getXRef(), Import::import(), IniParser::initFiles(), Y2SerialComponent::initializeConnection(), Debugger::initializeLocal(), Debugger::initializeRemote(), IniParser::initMachine(), Y2ProgramComponent::launchExternalProgram(), Y2PluginComponent::loadPlugin(), main(), YaST::make_crypt_salt(), Y2SerialComponent::make_raw(), TemporaryLocale::my_setlocale(), Xmlcode::namespaceId(), Bytecode::namespaceId(), Xmlcode::namespacePtr(), Bytecode::namespacePtr(), Y2SerialComponent::open_tty(), DummyAgent::otherCommand(), IniParser::parse(), AnyAgent::parseBoolean(), AnyAgent::parseChoice(), AnyAgent::parseData(), AnyAgent::parseHexval(), AnyAgent::parseHostname(), AnyAgent::parseIp4Number(), AnyAgent::parseNumber(), AnyAgent::parseUsername(), Xmlcode::popNamespace(), Bytecode::popNamespace(), Xmlcode::popUptoNamespace(), Bytecode::popUptoNamespace(), print_error(), Debugger::processInput(), program_stream(), Xmlcode::pushNamespace(), Bytecode::pushNamespace(), ModulesAgent::Read(), Y2AgentComp< Agent >::Read(), AnyAgent::Read(), IniSection::Read(), YCPDebugger::read_line(), YECall::readCall(), Xmlcode::readCode(), Bytecode::readCode(), Bytecode::readEntry(), Xmlcode::readFile(), Bytecode::readFile(), Xmlcode::readModule(), Bytecode::readModule(), Xmlcode::readType(), Bytecode::readType(), Bytecode::readValue(), AnyAgent::readValueByPath(), Bytecode::readYCodelist(), Y2ProgramComponent::receiveFromExternal(), StaticDeclaration::registerDeclarations(), Y2ComponentBroker::registerNamespaceException(), remove_directory(), Y2WFMComponent::SCROpen(), Y2ProgramComponent::sendToExternal(), Y2SerialComponent::set_fixed_line_speed(), IniEntry::setAllDoIt(), IniSection::setAllDoIt(), ModulesConf::setArgument(), YSymbolEntry::setCode(), YSymbolEntry::setDeclaration(), YFunction::setDefinition(), IniSection::setMyValue(), ModulesConf::setOption(), YSymbolEntry::setPayloadNamespace(), YSymbolEntry::setTable(), Y2SerialComponent::setup_serial_device(), SymbolEntry::setValue(), shellcommand(), shellcommand_background(), shellcommand_output(), SystemAgent::SystemAgent(), TableEntry::TableEntry(), SCRAgent::targetPath(), YCPExternalRep::toStream(), YCPListRep::toStream(), YConst::toStream(), SymbolEntry::toString(), YCode::toString(), YCPExternalRep::toXml(), YConst::toXml(), AnyAgent::unparseData(), AnyAgent::unparseList(), AnyAgent::unparseTuple(), YaST::utf82wchar(), YaST::wchar2utf8(), ModulesAgent::Write(), IniParser::write(), IniSection::Write(), IniParser::write_file(), YCPDebugger::write_line(), YCPDebugger::write_prompt(), Bytecode::writeEntry(), Xmlcode::writeFile(), Bytecode::writeFile(), ModulesConf::writeFile(), Bytecode::writeValue(), AnyAgent::writeValueByPath(), Xmlcode::writeYCodelist(), Bytecode::writeYCodelist(), xmlcodeistream::xmlcodeistream(), y2errPath(), YBlock::YBlock(), YConst::YConst(), YCPExternal::YCPExternal(), ycpmap2map(), YECall::YECall(), YEFunction::YEFunction(), YFunction::YFunction(), YSymbolEntry::YSymbolEntry(), and ModulesConf::~ModulesConf().
#define y2internal | ( | format, | |
args... | |||
) | y2logger(LOG_INTERNAL,format,##args) |
Referenced by Y2WFMComponent::createDefaultSCR(), YCPElementRep::destroy(), Y2Component::doActualWork(), YBreakpoint::evaluate(), Y2Component::evaluate(), YSBracket::evaluate(), YEFunctionPointer::evaluate(), Import::import(), Y2Component::import(), Scanner::LexerInput(), Parser::parse(), StaticDeclaration::registerDeclarations(), SymbolTable::remove(), switch(), YEBinary::type(), and WFMSubAgent::WFMSubAgent().
#define y2log_prefix "" |
#define y2log_suffix |
#define y2logger | ( | level, | |
format, | |||
args... | |||
) | y2_logger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,##args) |
Referenced by YaST::ExecutionEnvironment::backtrace().
#define y2lograw | ( | message | ) | y2_logger_raw(message) |
#define y2milestone | ( | format, | |
args... | |||
) | y2logger(LOG_MILESTONE,format,##args) |
Referenced by Y2CCWFM::createInLevel(), Y2AgentComp< Agent >::evaluate(), YBlock::evaluate(), Y2PluginComponent::loadPlugin(), main(), Y2ProgramComponent::receiveFromExternal(), Y2ProgramComponent::result(), Y2WFMComponent::SCRSetDefault(), Y2WFMComponent::SetLanguage(), Y2SerialComponent::setServerOptions(), SymbolTable::tableCopy(), while(), ModulesConf::writeFile(), SymbolTable::writeUsage(), SymbolTable::writeXmlUsage(), Y2LanguageLoader::Y2LanguageLoader(), YSImport::YSImport(), and YSWhile::YSWhile().
#define y2security | ( | format, | |
args... | |||
) | y2logger(LOG_SECURITY,format,##args) |
Referenced by Debugger::initializeLocal().
#define y2vlogger | ( | level, | |
format, | |||
ap | |||
) | y2_vlogger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,ap) |
#define y2warning | ( | format, | |
args... | |||
) | y2logger(LOG_WARNING,format,##args) |
Referenced by DummyAgent::checkPath(), YCPValueRep::compare(), Y2ComponentCreator::create(), IniAgent::Dir(), Y2StdioComponent::doActualWork(), Y2SerialComponent::doActualWork(), fillCache(), YCPPathSearch::find(), Y2PathSearch::findy2(), flushCache(), ModulesConf::getArgument(), Y2ComponentBroker::getNamespaceComponent(), ModulesConf::ModulesConf(), AnyAgent::otherCommand(), ScriptingAgent::parseSingleConfigFile(), Y2ComponentCreator::provideNamespace(), IniAgent::Read(), Bytecode::readValue(), ModulesConf::removeEntry(), s_sformat(), Y2WFMComponent::SetLanguage(), Y2SerialComponent::setServerOptions(), switch(), IniParser::UpdateIfModif(), ModulesConf::updateIfModified(), IniAgent::Write(), ModulesConf::writeFile(), and YConst::YConst().
enum loglevel_t |
bool get_log_debug | ( | ) |
whether debug logging is enabled
References log_debug.
string get_log_filename | ( | ) |
Logfile name reporting
References did_set_logname, logname, and set_log_filename().
void set_log_conf | ( | string | confname | ) |
Read an alternate logconf file y2log. If this is not done by the application the first call to y2log sets the logconf file as follows: users: $HOME/.yast2/log.conf root: /etc/YaST2/log.conf
Parse the log.conf
References did_read_logconf, log_all_variable, log_debug, log_to_file, log_to_syslog, logconf, logname, miniini(), set_signal_handler(), Y2LOG_CONF, Y2LOG_VAR_ALL, and Y2LOG_VAR_DEBUG.
Referenced by main(), process_options(), set_log_filename(), and should_be_logged().
void set_log_debug | ( | bool | on = true | ) |
void set_log_filename | ( | string | fname | ) |
Set an alternate logfile name for y2log. If this is not done by the application the first call to y2log sets the logfile name as follows: users: $HOME/.y2log root: /var/log/YaST2/y2log
The logname "-" is special: The log messages are written to stderr.
Logfile name initialization
References did_read_logconf, did_set_logname, log_to_file, log_to_syslog, logname, maxlognum, maxlogsize, set_log_conf(), stringutil::strtonum(), Y2LOG_FALLBACK, Y2LOG_MAXNUM, Y2LOG_MAXSIZE, Y2LOG_ROOT, Y2LOG_STDERR, Y2LOG_USER, Y2LOG_VAR_NUM, and Y2LOG_VAR_SIZE.
Referenced by do_log_yast(), get_log_filename(), Y2SLog::init(), main(), process_options(), and should_be_logged().
void set_log_simple_mode | ( | bool | simple | ) |
bool should_be_buffered | ( | ) |
Should we bother evaluating the arguments to the buffering function?
References Y2LOG_VAR_ONCRASH.
bool should_be_logged | ( | int | loglevel, |
const string & | componentname | ||
) |
Should we bother evaluating the arguments to the logging function?
Test if we should create a log entry
References did_read_logconf, did_set_logname, log_all_variable, log_debug, log_simple, logconf, set_log_conf(), and set_log_filename().
void void y2_logger_blanik | ( | loglevel_t | level, |
const string & | component, | ||
const char * | file, | ||
const int | line, | ||
const char * | func, | ||
const char * | format, | ||
... | |||
) |
void y2_logger_function | ( | loglevel_t | level, |
const string & | component, | ||
const char * | file, | ||
const int | line, | ||
const char * | func, | ||
const char * | format, | ||
... | |||
) |
void y2_logger_raw | ( | const char * | message | ) |
References do_log_syslog(), do_log_yast(), log_to_file, and log_to_syslog.
void y2_vlogger_blanik | ( | loglevel_t | level, |
const string & | component, | ||
const char * | file, | ||
const int | line, | ||
const char * | func, | ||
const char * | format, | ||
va_list | ap | ||
) |
References blanik, log_simple, log_to_file, log_to_syslog, LogTail::push_back(), y2_logfmt_common(), and y2_logfmt_prefix().
Referenced by y2_logger_blanik().
void void void y2_vlogger_function | ( | loglevel_t | level, |
const string & | component, | ||
const char * | file, | ||
const int | line, | ||
const char * | func, | ||
const char * | format, | ||
va_list | ap | ||
) |
References do_log_yast(), log_simple, log_to_file, log_to_syslog, y2_logfmt_common(), y2_logfmt_prefix(), and Y2LOG_SYSLOG.
Referenced by y2_logger_function().
LogTail blanik |
Referenced by signal_log_stored_debug(), and y2_vlogger_blanik().