y2log.h File Reference

#include <string>
#include <stdio.h>

Go to the source code of this file.

Classes

class  LogTail

Defines

#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 char *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 char *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 char *component, const char *file, const int line, const char *func, const char *format, va_list ap)
void y2_vlogger_blanik (loglevel_t level, const char *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, 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 Documentation

#define y2_logger ( level,
comp,
file,
line,
function,
format,
args...   ) 
Value:
do {                                                                    \
    if (should_be_logged (level, comp))                                 \
        y2_logger_function (level,comp,file,line,function,format,##args);\
    else if (should_be_buffered ())                                     \
        y2_logger_blanik (level,comp,file,line,function,format,##args); \
} while (0)

Referenced by YaSTLogger::doProcessLogMessage(), and Y2SLog::Y2Loglinebuf::writeout().

#define y2_vlogger ( level,
comp,
file,
line,
function,
format,
args   ) 
Value:
do {                                                                    \
    if (should_be_logged (level, comp))                                 \
        y2_vlogger_function (level,comp,file,line,function,format,args);\
    else if (should_be_buffered ())                                     \
        y2_vlogger_blanik (level,comp,file,line,function,format,args);  \
} while (0)
#define y2debug ( format,
args...   )     y2logger(LOG_DEBUG,format,##args)

Referenced by Y2Namespace::addSymbol(), Y2YCPFunction::appendParameter(), Y2SystemFunction::appendParameter(), Y2StdioFunction::appendParameter(), YBlock::attachEntry(), YECall::attachParameter(), YEBuiltin::attachParameter(), YETerm::attachParameter(), Y2SystemFunction::attachParameter(), YBlock::attachStatement(), YEBuiltin::attachSymVariable(), Type::basematch(), YSTextdomain::bind(), YLocale::bindDomainDir(), YCPPathSearch::bytecodeForFile(), Type::canCast(), YEPropagate::canPropagate(), DummyAgent::checkPath(), YEBuiltin::closeParameters(), SymbolTable::closeXRefs(), YSBracket::commit(), Type::commontype(), MapType::commontype(), ListType::commontype(), Y2ComponentBroker::createComponent(), YBlock::createFunctionCall(), Y2SystemNamespace::createFunctionCall(), Y2CCWFM::createInLevel(), IniSection::delMyValue(), IniSection::delSection(), YBlock::detachEnvironment(), Type::detailedtype(), MapType::detailedtype(), ListType::detailedtype(), Type::determineFlexType(), StdioSCRAgent::Dir(), IniSection::dirHelper(), Import::disableTracking(), SymbolTable::disableUsage(), Y2WFMComponent::doActualWork(), Y2ProgramComponent::doActualWork(), dump_value(), Import::enableTracking(), SymbolTable::enableUsage(), YBlock::endInclude(), SymbolTable::endUsage(), SymbolTable::enter(), StdioSCRAgent::Error(), YSSwitch::evaluate(), YSFilename::evaluate(), YSImport::evaluate(), YSDo::evaluate(), YSRepeat::evaluate(), YSWhile::evaluate(), YSIf::evaluate(), YSBracket::evaluate(), YSAssign::evaluate(), YSTypedef::evaluate(), YSFunction::evaluate(), YSReturn::evaluate(), YSBlock::evaluate(), YSExpression::evaluate(), YSContinue::evaluate(), YSBreak::evaluate(), YStatement::evaluate(), YEFunctionPointer::evaluate(), YEFunction::evaluate(), YEBuiltin::evaluate(), YEIs::evaluate(), YETriple::evaluate(), YEBinary::evaluate(), YEUnary::evaluate(), YEPropagate::evaluate(), YEMap::evaluate(), YEList::evaluate(), YELocale::evaluate(), YECompare::evaluate(), YETerm::evaluate(), YEReference::evaluate(), YEVariable::evaluate(), YCPReferenceRep::evaluate(), YCPEntryRep::evaluate(), YCPCodeRep::evaluate(), YFunction::evaluate(), YLocale::evaluate(), YConst::evaluate(), YCode::evaluate(), YBlock::evaluate(), Y2AgentComp< Agent >::evaluate(), Y2YCPFunction::evaluateCall(), Y2SystemFunction::evaluateCall(), Y2StdioFunction::evaluateCall(), YBlock::evaluateFrom(), StdioSCRAgent::Execute(), ScriptingAgent::Execute(), ScriptingAgent::executeSubagentCommand(), fillCache(), YECall::finalize(), YEBuiltin::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(), TestY2Component::import(), Import::import(), ScriptingAgent::InitRegDirs(), Scanner::initTables(), Y2ProgramComponent::launchExternalProgram(), Y2PluginComponent::loadPlugin(), Y2PluginComponent::locateSym(), main(), TableEntry::makeDefinition(), FunctionType::match(), TupleType::match(), BlockType::match(), MapType::match(), ListType::match(), VariableType::match(), NFlexType::match(), FlexType::match(), Type::match(), FunctionType::matchFlex(), TupleType::matchFlex(), BlockType::matchFlex(), MapType::matchFlex(), ListType::matchFlex(), VariableType::matchFlex(), NFlexType::matchFlex(), FlexType::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(), ExecutionEnvironment::popframe(), Xmlcode::popNamespace(), Bytecode::popNamespace(), Xmlcode::popUptoNamespace(), Bytecode::popUptoNamespace(), YBlock::pretachStatement(), Y2CCWFM::provideNamespace(), Y2CCSerial::provideNamespace(), Y2CCProgram::provideNamespace(), Y2CCPlugin::provideNamespace(), TestY2CC::provideNamespace(), ExecutionEnvironment::pushframe(), Xmlcode::pushNamespace(), Bytecode::pushNamespace(), StdioSCRAgent::Read(), ScriptingAgent::Read(), ResolverAgent::Read(), ModulesAgent::Read(), AnyAgent::Read(), SCRAgent::readconf(), StaticDeclaration::readDeclaration(), Bytecode::readEntry(), AnyAgent::readFile(), Xmlcode::readType(), Bytecode::readType(), Bytecode::readYCodelist(), Y2StdioComponent::receive(), recurseNext(), recurseStart(), StdioSCRAgent::RegisterAgent(), 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(), Y2ProgramComponent::sendToExternal(), IniSection::setAll(), ModuleEntry::setArgument(), YFunction::setDefinition(), YBlock::setKind(), Y2WFMComponent::SetLanguage(), IniSection::setMyValue(), ModuleEntry::setOption(), ModuleEntry::setOptions(), IniSection::setSectionProp(), SymbolEntry::setValue(), IniSection::setValue(), YCPListRep::shallowCopy(), shellcommand(), WFMSubAgent::start(), WFMSubAgent::start_and_check(), SymbolTable::startUsage(), StaticDeclaration::StaticDeclaration(), ScriptingAgent::Sweep(), SystemAgent::SystemAgent(), YBlock::table(), YSymbolEntry::toStream(), YSImport::toStream(), YStatement::toStream(), YCPTermRep::toStream(), YCPEntryRep::toStream(), YFunction::toStream(), YCode::toStream(), YBlock::toStream(), FunctionType::toStream(), NFlexType::toStream(), Type::toStream(), Point::toStream(), YFunction::toStreamDefinition(), YSymbolEntry::toString(), YECall::toString(), YEMap::toString(), SymbolEntry::toString(), YCode::toXml(), Point::toXml(), ScriptingAgent::tryRegister(), TupleType::TupleType(), YEBuiltin::type(), Type::Type(), FunctionType::unflex(), TupleType::unflex(), BlockType::unflex(), MapType::unflex(), ListType::unflex(), VariableType::unflex(), NFlexType::unflex(), FlexType::unflex(), SCRSubAgent::unmount(), 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(), StdioSCRAgent::UnregisterAgent(), ScriptingAgent::UnregisterAgent(), ScriptingAgent::UnregisterAllAgents(), IniParser::UpdateIfModif(), Y2SystemNamespace::useRemote(), AnyAgent::validateCache(), SymbolEntry::value(), WFM::WFM(), StdioSCRAgent::Write(), ResolverAgent::Write(), IniParser::write(), AnyAgent::Write(), StaticDeclaration::writeDeclaration(), ModulesConf::writeFile(), SymbolTable::writeUsage(), AnyAgent::writeValueByPath(), SymbolTable::writeXmlUsage(), Bytecode::writeYCodelist(), Y2LanguageLoader::Y2LanguageLoader(), Y2SystemFunction::Y2SystemFunction(), Y2WFMComponent::Y2WFMComponent(), Y2YCPFunction::Y2YCPFunction(), YBlock::YBlock(), YConst::YConst(), YEBuiltin::YEBuiltin(), YECall::YECall(), YEFunction::YEFunction(), YEFunctionPointer::YEFunctionPointer(), YEReference::YEReference(), YFunction::YFunction(), YSImport::YSImport(), YStatement::YStatement(), YSymbolEntry::YSymbolEntry(), SymbolTable::~SymbolTable(), Y2Namespace::~Y2Namespace(), and YBlock::~YBlock().

#define y2error ( format,
args...   )     y2logger(LOG_ERROR,format,##args)

Referenced by YBlock::attachEntry(), Y2YCPFunction::attachParameter(), Y2StdioFunction::attachParameter(), bytecodeistream::bytecodeistream(), FileDescr::changed(), Y2WFMComponent::ClientExists(), SymbolTable::closeXRefs(), Regex::compile(), Regex_t::compile(), crypt_pass(), IniSection::Delete(), IniSection::delSection(), IniSection::delValue(), IniSection::Dir(), Y2WFMComponent::doActualWork(), YBlock::endInclude(), ExecutionEnvironment::endlessRecursion(), AnyAgent::evalArg(), YEFunction::evaluate(), YCode::evaluate(), Y2StdioComponent::evaluate(), Y2SerialComponent::evaluate(), Y2ProgramComponent::evaluate(), Y2PluginComponent::evaluate(), Y2AgentComp< Agent >::evaluate(), Scanner::extend_scanbuffer(), FileDescr::FileDescr(), fillCache(), YEFunction::finalize(), IniSection::findEndFromUp(), IniSection::findSection(), AnyAgent::findSyntax(), Y2YCPFunction::finishParameters(), Y2StdioFunction::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(), IniParser::initMachine(), Y2ProgramComponent::launchExternalProgram(), Y2PluginComponent::loadPlugin(), main(), make_crypt_salt(), Y2SerialComponent::make_raw(), TemporaryLocale::my_setlocale(), Xmlcode::namespaceId(), Bytecode::namespaceId(), Xmlcode::namespacePtr(), Bytecode::namespacePtr(), Y2SerialComponent::open_tty(), StdioSCRAgent::otherCommand(), 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(), Xmlcode::pushNamespace(), Bytecode::pushNamespace(), Y2AgentComp< Agent >::Read(), ModulesAgent::Read(), IniSection::Read(), AnyAgent::Read(), YECall::readCall(), Xmlcode::readCode(), Bytecode::readCode(), Bytecode::readEntry(), Xmlcode::readFile(), Bytecode::readFile(), AnyAgent::readFile(), Xmlcode::readModule(), Bytecode::readModule(), Xmlcode::readType(), Bytecode::readType(), Bytecode::readValue(), AnyAgent::readValueByPath(), Bytecode::readYCodelist(), Y2ProgramComponent::receiveFromExternal(), StaticDeclaration::registerDeclarations(), Y2ComponentBroker::registerNamespaceException(), remove_directory(), s_lsubstring1(), s_lsubstring2(), 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(), YCPListRep::toStream(), YCPExternalRep::toStream(), YConst::toStream(), YCode::toString(), SymbolEntry::toString(), YCPExternalRep::toXml(), YConst::toXml(), AnyAgent::unparseData(), AnyAgent::unparseList(), AnyAgent::unparseTuple(), utf82wchar(), wchar2utf8(), ModulesAgent::Write(), IniParser::write(), IniSection::Write(), Bytecode::writeEntry(), Xmlcode::writeFile(), ModulesConf::writeFile(), Bytecode::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)
#define y2log_prefix   ""
#define y2log_suffix
#define y2logger ( level,
format,
args...   )     y2_logger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,##args)
#define y2lograw ( message   )     y2_logger_raw(message)
#define y2milestone ( format,
args...   )     y2logger(LOG_MILESTONE,format,##args)
#define y2security ( format,
args...   )     y2logger(LOG_SECURITY,format,##args)
#define y2vlogger ( level,
format,
ap   )     y2_vlogger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,ap)
#define y2warning ( format,
args...   )     y2logger(LOG_WARNING,format,##args)

Enumeration Type Documentation

enum loglevel_t
Enumerator:
LOG_DEBUG 
LOG_MILESTONE 
LOG_WARNING 
LOG_ERROR 
LOG_SECURITY 
LOG_INTERNAL 

Function Documentation

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  ) 

enable or disable debug logging

Parameters:
on true for on

References log_debug.

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  ) 

Set (or reset) the simple mode

References log_simple.

Referenced by main().

bool should_be_buffered (  ) 

Should we bother evaluating the arguments to the buffering function?

References Y2LOG_VAR_ONCRASH.

bool should_be_logged ( int  loglevel,
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 char *  component,
const char *  file,
const int  line,
const char *  func,
const char *  format,
  ... 
)
void y2_logger_function ( loglevel_t  level,
const char *  component,
const char *  file,
const int  line,
const char *  func,
const char *  format,
  ... 
)
void y2_logger_raw ( const char *  message  ) 
void y2_vlogger_blanik ( loglevel_t  level,
const char *  component,
const char *  file,
const int  line,
const char *  func,
const char *  format,
va_list  ap 
)
void void void y2_vlogger_function ( loglevel_t  level,
const char *  component,
const char *  file,
const int  line,
const char *  func,
const char *  format,
va_list  ap 
)

Variable Documentation


Generated on a sunny day for yast2-core by doxygen 1.6.3