-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-// cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore //
+// //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
+// //
+// See project site at http://redmine.teslayout.com/projects/anna-suite //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
#ifndef anna_core_tracing_Logger_hpp
@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
@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:
/**
@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;
@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
@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
@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;
}
@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.
*
* \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.
@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.
@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);
}
@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.
@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);
}
@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);
}
@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.
@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.
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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.
\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;