X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Fcore%2Ftracing%2FLogger.hpp;fp=include%2Fanna%2Fcore%2Ftracing%2FLogger.hpp;h=ec0c50e37b7154a3fc66ab6873d0c68ec6c8495e;hp=de92545924625866abbc1d15109f36e19d6ef121;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/include/anna/core/tracing/Logger.hpp b/include/anna/core/tracing/Logger.hpp index de92545..ec0c50e 100644 --- a/include/anna/core/tracing/Logger.hpp +++ b/include/anna/core/tracing/Logger.hpp @@ -63,7 +63,7 @@ public: @param id Identificador logico. Usado en el DefaultWriter para inicializar el sistema del log (metodo syslog). */ - virtual void initialize(const char* id) throw() = 0; + virtual void initialize(const char* id) = 0; /** Transfiere el mensaje de trazas al log del sistema. El metodo implementado debe ser @@ -75,7 +75,7 @@ public: @param level Nivel de las trazas que vamos a sacar. @param text Especificacion de formato del mensaje. Similar al usado en el comando sprintf. */ - virtual void do_write(int level, const char* text, ...) throw() = 0; + virtual void do_write(int level, const char* text, ...) = 0; protected: /** @@ -94,7 +94,7 @@ public: @return La instancia del bloque de datos con memoria reservada para poder interpretar los parametros. */ - DataBlock& getDataBlock() throw() { return *a_dataBlock; } + DataBlock& getDataBlock() { return *a_dataBlock; } private: DataBlock* a_dataBlock; @@ -116,7 +116,7 @@ public: @see DefaultWriter. */ - static void initialize(const char* ident) throw(); + static void initialize(const char* ident) ; /** Inicializa el sistema de historico de nuestra aplicacion. Solo debe invocarse una unica vez @@ -135,12 +135,12 @@ public: @see DefaultWriter. */ - static void initialize(const char* ident, Writer* writer) throw(); + static void initialize(const char* ident, Writer* writer) ; /** @return El nivel de trazado de nuestra aplicacion. */ - static Level getLevel() throw() { return st_level; } + static Level getLevel() { return st_level; } /** Establece el nivel de trazado de nuestra aplicacion. El nivel de trazado por defecto @@ -153,7 +153,7 @@ public: @param level Nivel de trazado que deseamos establecer. */ static void setLevel(const Level level) - throw(RuntimeException) { + noexcept(false) { Guard guard(st_mutex, "Logger::setLevel"); st_level = (level <= Error) ? Error : level; } @@ -166,20 +166,20 @@ public: @return @em true Si el nivel de trazado de nuestra aplicacion es mayor que el recibido como parametro o @em false en otro caso. */ - static bool isActive(const Level level) throw() { + static bool isActive(const Level level) { return (st_writer != NULL && level <= Error) ? true : (st_enabled && level <= st_level && st_writer != NULL); } /** Desactiva el sistema de trazado. */ - static void disable() throw(RuntimeException); + static void disable() noexcept(false); /** Activa el sistema de trazado y establece el nivel de trazado existente antes de la desactivacion (Ver #disable). */ - static void enable() throw(RuntimeException); + static void enable() noexcept(false); /** * Establece el valor del indicador que hace que se vuelque el PID del proceso en la linea de trazas. @@ -188,7 +188,7 @@ public: * * \param showPID Valor del indicador. */ - static void showPID(const bool show) throw(); + static void showPID(const bool show) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -201,7 +201,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const char* text, const char* fromFile, const int fromLine) throw(); + static void write(const Level level, const char* text, const char* fromFile, const int fromLine) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -214,7 +214,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const std::string& text, const char* fromFile, const int fromLine) throw() { + static void write(const Level level, const std::string& text, const char* fromFile, const int fromLine) { write(level, text.c_str(), fromFile, fromLine); } @@ -230,7 +230,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const char* text, const char* value, const char* fromFile, const int fromLine) throw(); + static void write(const Level level, const char* text, const char* value, const char* fromFile, const int fromLine) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -245,7 +245,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const std::string& value, const char* fromFile, const int fromLine) - throw() { + { write(level, text, value.c_str(), fromFile, fromLine); } @@ -262,7 +262,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const std::string& text, const std::string& value, const char* fromFile, const int fromLine) - throw() { + { write(level, text.c_str(), value.c_str(), fromFile, fromLine); } @@ -279,7 +279,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const int value, const char* fromFile, const int fromLine) - throw(); + ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -294,7 +294,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const DataBlock& value, const char* fromFile, const int fromLine) - throw(); + ; /** Si el nivel \em Debug esta activado traza el texto recibido en el historico. @@ -303,7 +303,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void debug(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Debug, text, fromFile, fromLine); } @@ -314,7 +314,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void information(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Information, text, fromFile, fromLine); } @@ -325,7 +325,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void notice(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Notice, text, fromFile, fromLine); } @@ -336,7 +336,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void warning(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Warning, text, fromFile, fromLine); } @@ -347,7 +347,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void error(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Error, text, fromFile, fromLine); } @@ -358,7 +358,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void critical(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Critical, text, fromFile, fromLine); } @@ -369,7 +369,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void alert(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Alert, text, fromFile, fromLine); } @@ -380,7 +380,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void emergency(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Emergency, text, fromFile, fromLine); } @@ -388,7 +388,7 @@ public: @return La cadena que identifica al nivel recibido como parametro. */ - static const char* asString(const Level level) throw(); + static const char* asString(const Level level) ; /** Traduce la cadena recibida al nivel correspondiente. @@ -397,7 +397,7 @@ public: \warning Debe de ser alguno de los siguiente literales: emerg, alert, crit, err, warning, notice, info, debug */ - static Level asLevel(const char* level) throw(RuntimeException); + static Level asLevel(const char* level) noexcept(false); private: static NRMutex st_mutex;