1 #ifndef EDepSim_LogManager_hxx_seen 2 #define EDepSim_LogManager_hxx_seen 379 namespace EDepSim {
class LogManager;}
429 static void SetLogLevel(
const char* trace, LogPriority level);
472 #ifndef _EDEPSIM_OUTPUT_ERROR 473 # define _EDEPSIM_OUTPUT_ERROR(trace,outStream) \ 475 std::ios::fmtflags save \ 476 = EDepSim::LogManager::GetDebugStream().flags(); \ 477 EDepSim::LogManager::GetDebugStream() << trace << __FILE__ \ 478 << ":" << __LINE__ << ": " \ 480 << std::setprecision(6) \ 482 << std::setfill(' ') \ 484 EDepSim::LogManager::GetDebugStream().flags(save); \ 492 #ifndef EDEPSIM_ERROR_OUTPUT 493 # define EDEPSIM_ERROR_OUTPUT true 503 # define EDepSimError(outStream) \ 505 if (EDEPSIM_ERROR_OUTPUT) { \ 506 _EDEPSIM_OUTPUT_ERROR("ERROR: ",outStream); \ 510 #warning EDepSimError has been redefined and unexpected behaviour may result. 513 #ifndef EDepSimNamedError 520 # define EDepSimNamedError(trace,outStream) \ 522 if (EDEPSIM_ERROR_OUTPUT) { \ 523 if (EDepSim::LogManager::ErrorLevel \ 524 <= EDepSim::LogManager::GetDebugLevel(trace)) \ 525 _EDEPSIM_OUTPUT_ERROR("ERROR[" trace "]: ", outStream); \ 529 #warning EDepSimNamedError has been redefined and unexpected behaviour \ 533 #ifndef EDepSimSevere 539 # define EDepSimSevere(outStream) \ 541 if (EDEPSIM_ERROR_OUTPUT) { \ 542 if (EDepSim::LogManager::SevereLevel \ 543 <= EDepSim::LogManager::GetDebugLevel()) \ 544 _EDEPSIM_OUTPUT_ERROR("SEVERE: ",outStream); \ 548 #warning EDepSimSevere has been redefined and unexpected behaviour may result. 551 #ifndef EDepSimNamedSevere 558 # define EDepSimNamedSevere(trace,outStream) \ 560 if (EDEPSIM_ERROR_OUTPUT) { \ 561 if (EDepSim::LogManager::SevereLevel \ 562 <= EDepSim::LogManager::GetDebugLevel(trace)) \ 563 _EDEPSIM_OUTPUT_ERROR("SEVERE[" trace "]: ", outStream); \ 567 #warning EDepSimNamedSevere has been redefined and unexpected behaviour \ 576 # define EDepSimWarn(outStream) \ 578 if (EDEPSIM_ERROR_OUTPUT) { \ 579 if (EDepSim::LogManager::WarnLevel \ 580 <= EDepSim::LogManager::GetDebugLevel()) \ 581 _EDEPSIM_OUTPUT_ERROR("WARNING: ",outStream); \ 585 #warning EDepSimWarn has been redefined and unexpected behaviour may result. 588 #ifndef EDepSimNamedWarn 594 # define EDepSimNamedWarn(trace,outStream) \ 596 if (EDEPSIM_ERROR_OUTPUT) { \ 597 if (EDepSim::LogManager::WarnLevel \ 598 <= EDepSim::LogManager::GetDebugLevel(trace)) \ 599 _EDEPSIM_OUTPUT_ERROR("WARNING[" trace "]: ", outStream); \ 603 #warning EDepSimNamedWarn has been redefined and unexpected behaviour may \ 614 #define EDepSimDebug(outStream) \ 616 if (EDEPSIM_ERROR_OUTPUT) { \ 617 if (EDepSim::LogManager::DebugLevel \ 618 <= EDepSim::LogManager::GetDebugLevel()) \ 619 _EDEPSIM_OUTPUT_ERROR("DEBUG: ",outStream); \ 623 #warning EDepSimDebug has been redefined and unexpected behaviour may result. 626 #ifndef EDepSimNamedDebug 634 #define EDepSimNamedDebug(trace,outStream) \ 636 if (EDEPSIM_ERROR_OUTPUT) { \ 637 if (EDepSim::LogManager::DebugLevel \ 638 <= EDepSim::LogManager::GetDebugLevel(trace)) \ 639 _EDEPSIM_OUTPUT_ERROR("DEBUG[" trace "]: ", outStream); \ 643 #warning EDepSimNamedDebug has been redefined and unexpected behaviour \ 653 # define EDepSimTrace(outStream) \ 655 if (EDEPSIM_ERROR_OUTPUT) { \ 656 if (EDepSim::LogManager::TraceLevel \ 657 <= EDepSim::LogManager::GetDebugLevel()) \ 658 _EDEPSIM_OUTPUT_ERROR("TRACE:",outStream); \ 662 #warning EDepSimTrace has been redefined and unexpected behaviour may result. 665 #ifndef EDepSimNamedTrace 672 #define EDepSimNamedTrace(trace,outStream) \ 674 if (EDEPSIM_ERROR_OUTPUT) { \ 675 if (EDepSim::LogManager::TraceLevel \ 676 <= EDepSim::LogManager::GetDebugLevel(trace)) \ 677 _EDEPSIM_OUTPUT_ERROR("TRACE[" trace "]: ", outStream); \ 681 #warning EDepSimNamedTrace has been redefined and unexpected behaviour \ 687 #ifndef _EDEPSIM_OUTPUT_LOG 688 # define _EDEPSIM_OUTPUT_LOG(trace,outStream) \ 690 std::ios::fmtflags save \ 691 = EDepSim::LogManager::GetLogStream().flags(); \ 692 EDepSim::LogManager::GetLogStream() \ 694 << EDepSim::LogManager::MakeIndent() \ 696 << std::setprecision(6) \ 698 << std::setfill(' ') \ 700 EDepSim::LogManager::GetLogStream().flags(save); \ 708 #ifndef EDEPSIM_LOG_OUTPUT 709 # define EDEPSIM_LOG_OUTPUT true 717 #define EDepSimLog(outStream) \ 719 if (EDEPSIM_LOG_OUTPUT) { \ 720 if (EDepSim::LogManager::LogLevel \ 721 <= EDepSim::LogManager::GetLogLevel()) \ 722 _EDEPSIM_OUTPUT_LOG("% ",outStream); \ 726 #warning EDepSim_Log has been redefined and unexpected logging \ 727 behaviour may result. 730 #ifndef EDepSimNamedLog 735 #define EDepSimNamedLog(trace,outStream) \ 737 if (EDEPSIM_LOG_OUTPUT) { \ 738 if (EDepSim::LogManager::LogLevel \ 739 <= EDepSim::LogManager::GetLogLevel(trace)) \ 740 _EDEPSIM_OUTPUT_LOG("% [" trace "] ",outStream); \ 744 #warning EDepSimNamedLog has been redefined and unexpected logging \ 745 behaviour may result. 752 # define EDepSimInfo(outStream) \ 754 if (EDEPSIM_LOG_OUTPUT) { \ 755 if (EDepSim::LogManager::InfoLevel \ 756 <= EDepSim::LogManager::GetLogLevel()) \ 757 _EDEPSIM_OUTPUT_LOG("%% ",outStream); \ 761 #warning EDepSimInfo has been redefined and unexpected logging \ 762 behaviour may result. 765 #ifndef EDepSimNamedInfo 770 # define EDepSimNamedInfo(trace,outStream) \ 772 if (EDEPSIM_LOG_OUTPUT) { \ 773 if (EDepSim::LogManager::InfoLevel \ 774 <= EDepSim::LogManager::GetLogLevel(trace)) \ 775 _EDEPSIM_OUTPUT_LOG("%% [" trace "] ",outStream); \ 779 #warning EDepSimNamedInfo has been redefined and unexpected logging \ 780 behaviour may result. 783 #ifndef EDepSimVerbose 787 # define EDepSimVerbose(outStream) \ 789 if (EDEPSIM_LOG_OUTPUT) { \ 790 if (EDepSim::LogManager::VerboseLevel \ 791 <= EDepSim::LogManager::GetLogLevel()) \ 792 _EDEPSIM_OUTPUT_LOG("%%% ",outStream); \ 796 #warning EDepSimVerbose has been redefined and unexpected logging \ 797 behaviour may result. 800 #ifndef EDepSimNamedVerbose 805 # define EDepSimNamedVerbose(trace,outStream) \ 807 if (EDEPSIM_LOG_OUTPUT) { \ 808 if (EDepSim::LogManager::VerboseLevel \ 809 <= EDepSim::LogManager::GetLogLevel(trace)) \ 810 _EDEPSIM_OUTPUT_LOG("%%% [" trace "] ",outStream); \ 814 #warning EDepSimNamedVerbose has been redefined and unexpected logging \ 815 behaviour may result. static void SetIndentation(int i)
Set the indentation level for a log message.
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
static std::ostream & GetLogStream()
Return the stream associated with the log file.
static void SetLogLevel(LogPriority level)
Set the default logging level.
static ErrorPriority fErrorPriority
static std::map< std::string, ErrorPriority > fErrorTraces
static std::string MakeIndent()
[Internal method] Make an indentation for a log message.
static std::map< std::string, LogPriority > fLogTraces
static LogPriority fLogPriority
static void ResetIndentation()
Reset the indentation to zero.
static std::ostream * fLogStream
M::value_type trace(const M &m)
Construct a module from components.
static void SetLogStream(std::ostream *log)
Set the output stream to be used for log messages.
static void DecreaseIndentation()
Decrease the indentation level.
void err(const char *fmt,...)
static void SetDebugLevel(ErrorPriority level)
static void IncreaseIndentation()
Increase the indentation level.
static std::ostream & GetDebugStream()
Return the stream associated with the error file.
static void SetDebugStream(std::ostream *err)
Set the output stream to be used for error messages.
static LogPriority GetLogLevel()
Get the current logging level;.
static void Configure(const char *conf=NULL)
static std::ostream * fDebugStream