Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
inexor::util::log_manager Class Reference

The global inexor logging API TODO: enable sharing. More...

#include <Logging.hpp>

Public Member Functions

 log_manager ()
 
Loggeroperator-> () const
 We allow the syntax Log.info("hallo") and forward it to the logger log_manager::default. More...
 

Static Public Member Functions

static Logger create_and_register_logger (std::string logger_name, const std::string pattern=DEFAULT_LOG_PATTERN, int level=spdlog::level::info)
 Register logger to spdlog or replace it if the name is already taken. More...
 

Public Attributes

SharedVar< char * > logfile
 The absolute path of the logfile which gets created as sink. More...
 

Static Public Attributes

static Logger std = log_manager::create_and_register_logger("std")
 Logger for everything not fitting elsewhere. More...
 
static Logger start_stop = log_manager::create_and_register_logger("start_stop")
 Logger for the startup and the shut down of the game. More...
 
static Logger sync = log_manager::create_and_register_logger("sync")
 Logger for synchronization messages. More...
 
static Logger io = log_manager::create_and_register_logger("io")
 Logger for the filesystem messages and other input/output. More...
 
static Logger util = log_manager::create_and_register_logger("util")
 Logger for utility functions. More...
 
static Logger render = log_manager::create_and_register_logger("render")
 Logger for rendering messages. More...
 
static Logger ui = log_manager::create_and_register_logger("ui")
 Logger for the user interface rendering (CEF bindings). More...
 
static Logger game = log_manager::create_and_register_logger("game")
 Logger for all general game messages. More...
 
static Logger frag_involved = log_manager::create_and_register_logger("frag_involved")
 Logger for "you got killed" or "you killed xy". More...
 
static Logger frag_not_involved = log_manager::create_and_register_logger("frag_not_involved")
 Logger for "player1 killed playerC". More...
 
static Logger chat = log_manager::create_and_register_logger("chat")
 Logger for chat messages. More...
 
static Logger team_chat = log_manager::create_and_register_logger("teamchat")
 Logger for team chat messages. More...
 
static Logger world = log_manager::create_and_register_logger("world")
 Logger for world related functions. More...
 
static Logger edit = log_manager::create_and_register_logger("edit")
 Logger for messages of the editing mode. More...
 

Private Member Functions

void all_loggers_apply_sinks_change ()
 After adding a sink we need to recreate all loggers to make them use them. More...
 

Detailed Description

The global inexor logging API TODO: enable sharing.

Constructor & Destructor Documentation

inexor::util::log_manager::log_manager ( )

Member Function Documentation

void inexor::util::log_manager::all_loggers_apply_sinks_change ( )
private

After adding a sink we need to recreate all loggers to make them use them.

Since we can't modify the sinks of existing loggers.

References chat, edit, frag_involved, frag_not_involved, game, io, inexor::util::Logger::recreate_spdlog_logger(), render, start_stop, std, sync, team_chat, ui, util, and world.

Referenced by log_manager().

Logger inexor::util::log_manager::create_and_register_logger ( std::string  logger_name,
const std::string  pattern = DEFAULT_LOG_PATTERN,
int  level = spdlog::level::info 
)
static

Register logger to spdlog or replace it if the name is already taken.

References inexor::util::Logger::create_spdlog_logger(), and inexor::util::Logger::level.

Logger& inexor::util::log_manager::operator-> ( ) const
inline

We allow the syntax Log.info("hallo") and forward it to the logger log_manager::default.

References std.

Member Data Documentation

Logger inexor::util::log_manager::chat = log_manager::create_and_register_logger("chat")
static
Logger inexor::util::log_manager::edit = log_manager::create_and_register_logger("edit")
static

Logger for messages of the editing mode.

e.g. "player1 has recalculated his lightmaps." may be conflicting with the "world"-logger sometimes: in that case prefer edit.

Referenced by all_loggers_apply_sinks_change(), game::allowedittoggle(), calclight(), canpaintblendmap(), delprefab(), emptymap(), enlargemap(), findtype(), genpvs(), game::getmap(), newentity(), noedit(), noentedit(), game::parsemessages(), patchlight(), game::printvar(), pvsstats(), game::receivefile(), save_world(), saveprefab(), game::sendmap(), showtexgui(), and testpvs().

Logger inexor::util::log_manager::frag_involved = log_manager::create_and_register_logger("frag_involved")
static

Logger for "you got killed" or "you killed xy".

Referenced by all_loggers_apply_sinks_change(), and game::killed().

Logger inexor::util::log_manager::frag_not_involved = log_manager::create_and_register_logger("frag_not_involved")
static

Logger for "player1 killed playerC".

Referenced by all_loggers_apply_sinks_change(), and game::killed().

Logger inexor::util::log_manager::game = log_manager::create_and_register_logger("game")
static
Logger inexor::util::log_manager::io = log_manager::create_and_register_logger("io")
static

Logger for the filesystem messages and other input/output.

E.g. "file not available" or "no keyboard available" or "model xy has a malformatted header".

Referenced by all_loggers_apply_sinks_change(), gzstream::finishreading(), and log_manager().

SharedVar<char *> inexor::util::log_manager::logfile

The absolute path of the logfile which gets created as sink.

Referenced by log_manager(), and main().

Logger inexor::util::log_manager::render = log_manager::create_and_register_logger("render")
static

Logger for rendering messages.

Referenced by all_loggers_apply_sinks_change().

Logger inexor::util::log_manager::start_stop = log_manager::create_and_register_logger("start_stop")
static

Logger for the startup and the shut down of the game.

Referenced by all_loggers_apply_sinks_change(), and main().

Logger inexor::util::log_manager::std = log_manager::create_and_register_logger("std")
static

Logger for everything not fitting elsewhere.

Initialize the static members of the log_manager class.

static members have no explicit parent, meaning first usage initializes these members.

Referenced by addblendbrush(), addcomplete(), decalrenderer::adddecal(), addpostfx(), all_loggers_apply_sinks_change(), bindkey(), calclight(), server::bombservermode::canspawn(), clearmodel(), aviwriter::close(), connectserv(), cubemapload(), cubemaploadwildcard(), debugalias(), debugcode(), debugcodeline(), disconnect(), server::disconnect_client(), editmat(), entinmap(), execfile(), fatal(), particleemitter::finalize(), flushpreloadedmodels(), game::follow(), gendds(), genvbo(), game::getdemo(), gets2c(), gl_checkextensions(), gl_rendercef(), inexor::ui::layer::InexorLayerManager::HideLayer(), inexor::ui::layer::InexorLayerManager::InitializeLayer(), inexor::sound::initmumble(), keymap(), game::listdemos(), inexor::sound::soundsample::load(), md3::md3meshgroup::load(), md2::load(), loaddds(), md3::loaddefaultparts(), obj::loaddefaultparts(), iqm::iqmmeshgroup::loadiqmmeshes(), md5::md5meshgroup::loadmesh(), vertcommands< MDL >::loadpart(), skelcommands< MDL >::loadpart(), loadprefab(), loadsky(), loadskyoverlay(), lockpvs_(), multiplayer(), neterr(), game::nextfollow(), operator->(), game::parsemessages(), server::parsepacket(), patchlight(), inexor::sound::playsound(), preloadusedmapmodels(), printcube(), printfvar(), game::printname(), printsvar(), game::printteam(), printvar(), game::receivefile(), reconnect(), reloadtex(), replace(), reportinvalidtextslot(), server::run_server(), savepng(), saveprefab(), savetga(), server::serverslice(), skelcommands< MDL >::setadjust(), vertcommands< MDL >::setanim(), animmodel::part::setanim(), skelcommands< MDL >::setanim(), skelcommands< MDL >::setanimpart(), modelcommands< MDL, struct MDL::vertmesh >::setdir(), modelcommands< MDL, struct MDL::vertmesh >::setlink(), vertcommands< MDL >::setpitch(), skelcommands< MDL >::setpitch(), skelcommands< MDL >::setpitchcorrect(), skelcommands< MDL >::setpitchtarget(), setshader(), skelcommands< MDL >::settag(), server::setup_network_sockets(), inexor::rendering::screen::ScreenManager::setupscreen(), showglslinfo(), inexor::ui::layer::InexorLayerManager::ShowLayer(), shrinkmap(), recorder::start(), recorder::stop(), game::stopfollowing(), inexor::sound::stopsound(), swapundo(), entities::teleport(), texture(), texturedata(), trydisconnect(), and updateparticles().

Logger inexor::util::log_manager::sync = log_manager::create_and_register_logger("sync")
static
Logger inexor::util::log_manager::team_chat = log_manager::create_and_register_logger("teamchat")
static
Logger inexor::util::log_manager::ui = log_manager::create_and_register_logger("ui")
static
Logger inexor::util::log_manager::util = log_manager::create_and_register_logger("util")
static

Logger for utility functions.

e.g. you may want all string_copy-warnings to be on "error"-level in production.

Referenced by all_loggers_apply_sinks_change().

Logger inexor::util::log_manager::world = log_manager::create_and_register_logger("world")
static

Logger for world related functions.

e.g. verbose("octree-extension has been loaded to (0, 1024, 1024).");

Referenced by all_loggers_apply_sinks_change(), load_world(), loadents(), ai::loadwaypoints(), save_world(), and ai::savewaypoints().


The documentation for this class was generated from the following files: