yast2-core
Classes | Macros | Enumerations | Functions | Variables
liby2util-r/src/include/y2util/y2log.h File Reference
#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 ()
 
void shift_log_files_if_needed (string filename)
 

Variables

LogTail blanik
 

Macro Definition 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)
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
std::string format(const char *format,...) __attribute__((format(printf
Definition: IniParser.cc:1030
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
bool should_be_logged(int loglevel, const string &componentname)
Definition: y2log.cc:550
enters the component to the broker s list in the given order Y2Component int level
Definition: componentcreator.txt:21
bool should_be_buffered()
Definition: y2log.cc:597
Interface specification for modules and all text on a line after a Lines may be continued by ending the line with a The remaining lines should all conform to one of the following are used in the etc modules problems begin When we do not want to break the file
Definition: modules_conf.altern.txt:2

Referenced by 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)
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)
Definition: y2log.cc:275
std::string format(const char *format,...) __attribute__((format(printf
Definition: IniParser.cc:1030
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)
Definition: y2log.cc:300
bool should_be_logged(int loglevel, const string &componentname)
Definition: y2log.cc:550
enters the component to the broker s list in the given order Y2Component int level
Definition: componentcreator.txt:21
bool should_be_buffered()
Definition: y2log.cc:597
Interface specification for modules and all text on a line after a Lines may be continued by ending the line with a The remaining lines should all conform to one of the following are used in the etc modules problems begin When we do not want to break the file
Definition: modules_conf.altern.txt:2
#define y2debug (   format,
  args... 
)    y2logger(LOG_DEBUG,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(), YLocale::evaluate(), YSWhile::evaluate(), YCPReferenceRep::evaluate(), YSRepeat::evaluate(), YSDo::evaluate(), YFunction::evaluate(), YEBuiltin::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(), ProcessAgent::ProcessOutput(), 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(), shellcommand_background(), 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().

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

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(), dump_value(), 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(), YCPDebugger::print_scope(), Debugger::processInput(), ProcessAgent::ProcessOutput(), 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(), Y2StdioComponent::send(), Y2ProgramComponent::sendToExternal(), Y2SerialComponent::sendToSerial(), 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(), ModulesConf::~ModulesConf(), and ProcessAgent::~ProcessAgent().

#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
ontrue 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(), shellcommand_background(), and should_be_logged().

void set_log_simple_mode ( bool  simple)

Set (or reset) the simple mode

References log_simple.

Referenced by main().

void shift_log_files_if_needed ( string  filename)

Check if the logs need rotating; if yes, do it. We do all of this ourselves because during the installation logrotate does not run

Maintain logfiles We do all of this ourselves because during the installation logrotate does not run

References __attribute__(), maxlognum, maxlogsize, and old().

Referenced by do_log_yast().

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)
void 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 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 
)

Variable Documentation

LogTail blanik

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