OmniSciDB
0264ff685a
|
Namespaces | |
anonymous_namespace{Logger.cpp} | |
Classes | |
class | DebugTimer |
class | Duration |
class | DurationTree |
struct | EraseDurationTrees |
Depth-first search and erase all DurationTrees. Not thread-safe. More... | |
struct | GetDepth |
class | JsonEncoder |
class | Logger |
class | LogOptions |
struct | LogShutdown |
Typedefs | |
using | ClogSync = sinks::synchronous_sink< sinks::text_ostream_backend > |
using | FileSync = sinks::synchronous_sink< sinks::text_file_backend > |
using | Clock = std::chrono::steady_clock |
using | DurationTreeNode = boost::variant< Duration, DurationTree & > |
using | DurationTreeNodes = std::deque< DurationTreeNode > |
using | DurationTreeMap = std::unordered_map< ThreadId, std::unique_ptr< DurationTree > > |
using | Channels = std::set< Channel > |
using | FatalFunc = void(*)() noexcept |
using | ChannelLogger = boost::log::sources::channel_logger_mt< Channel > |
using | SeverityLogger = boost::log::sources::severity_logger_mt< Severity > |
using | ThreadId = uint64_t |
Enumerations | |
enum | Channel { IR = 0, PTX, ASM, _NCHANNELS } |
enum | Severity { DEBUG4 = 0, DEBUG3, DEBUG2, DEBUG1, INFO, WARNING, ERROR, FATAL, _NSEVERITIES } |
Functions | |
std::string | filename (char const *path) |
template<typename TAG > | |
std::string | replace_braces (std::string const &str, TAG const tag) |
boost::log::attributes::current_process_id::value_type::native_type | get_native_process_id (boost::log::value_ref< boost::log::attributes::current_process_id::value_type, tag::process_id > const &pid) |
template<typename SINK > | |
sinks::text_file_backend::open_handler_type | create_or_replace_symlink (boost::weak_ptr< SINK > weak_ptr, std::string &&symlink) |
boost::log::formatting_ostream & | operator<< (boost::log::formatting_ostream &strm, boost::log::to_log_manip< Channel, tag::channel > const &manip) |
boost::log::formatting_ostream & | operator<< (boost::log::formatting_ostream &strm, boost::log::to_log_manip< Severity, tag::severity > const &manip) |
template<typename TAG , typename SINK > | |
void | set_formatter (SINK &sink) |
template<typename FILE_SINK , typename TAG > | |
boost::shared_ptr< FILE_SINK > | make_sink (LogOptions const &log_opts, boost::filesystem::path const &full_log_dir, TAG const tag) |
template<typename CONSOLE_SINK > | |
boost::shared_ptr< CONSOLE_SINK > | make_sink (LogOptions const &log_opts) |
void | init (LogOptions const &log_opts) |
void | set_once_fatal_func (FatalFunc fatal_func) |
void | shutdown () |
std::istream & | operator>> (std::istream &in, Channels &channels) |
std::ostream & | operator<< (std::ostream &out, Channels const &channels) |
std::istream & | operator>> (std::istream &in, Severity &sev) |
std::ostream & | operator<< (std::ostream &out, Severity const &sev) |
template<typename... Ts> | |
Duration * | newDuration (Severity severity, Ts &&... args) |
std::ostream & | operator<< (std::ostream &os, Duration const &duration) |
std::ostream & | operator<< (std::ostream &os, DurationTree const &duration_tree) |
boost::log::record_ostream & | operator<< (boost::log::record_ostream &os, DurationTreeMap::const_reference kv_pair) |
void | logAndEraseDurationTree (std::string *json_str) |
void | debug_timer_new_thread (ThreadId parent_thread_id) |
ThreadId | thread_id () |
bool | fast_logging_check (Channel) |
bool | fast_logging_check (Severity severity) |
template<typename X , typename Y > | |
BOOST_NOINLINE std::string * | check_failed (X const &x, Y const &y, char const *xstr, char const *ystr, char const *op_str) |
Variables | |
std::atomic< FatalFunc > | g_fatal_func {nullptr} |
std::once_flag | g_fatal_func_flag |
bool | g_any_active_channels {false} |
Severity | g_min_active_severity {Severity::FATAL} |
std::mutex | g_duration_tree_map_mutex |
DurationTreeMap | g_duration_tree_map |
std::atomic< ThreadId > | g_next_thread_id {0} |
ThreadId thread_local const | g_thread_id = g_next_thread_id++ |
constexpr std::array< char const *, 3 > | ChannelNames {"IR", "PTX", "ASM"} |
constexpr std::array< char, 3 > | ChannelSymbols {'R', 'P', 'A'} |
constexpr std::array< char const *, 8 > | SeverityNames |
constexpr std::array< char, 8 > | SeveritySymbols {'4', '3', '2', '1', 'I', 'W', 'E', 'F'} |
using logger::ChannelLogger = typedef boost::log::sources::channel_logger_mt<Channel> |
using logger::Channels = typedef std::set<Channel> |
using logger::Clock = typedef std::chrono::steady_clock |
Definition at line 428 of file Logger.cpp.
using logger::ClogSync = typedef sinks::synchronous_sink<sinks::text_ostream_backend> |
Definition at line 262 of file Logger.cpp.
using logger::DurationTreeMap = typedef std::unordered_map<ThreadId, std::unique_ptr<DurationTree> > |
Definition at line 523 of file Logger.cpp.
using logger::DurationTreeNode = typedef boost::variant<Duration, DurationTree&> |
Definition at line 466 of file Logger.cpp.
using logger::DurationTreeNodes = typedef std::deque<DurationTreeNode> |
Definition at line 467 of file Logger.cpp.
using logger::FatalFunc = typedef void (*)() noexcept |
using logger::FileSync = typedef sinks::synchronous_sink<sinks::text_file_backend> |
Definition at line 263 of file Logger.cpp.
using logger::SeverityLogger = typedef boost::log::sources::severity_logger_mt<Severity> |
using logger::ThreadId = typedef uint64_t |
enum logger::Channel |
Enumerator | |
---|---|
IR | |
PTX | |
ASM | |
_NCHANNELS |
enum logger::Severity |
Enumerator | |
---|---|
DEBUG4 | |
DEBUG3 | |
DEBUG2 | |
DEBUG1 | |
INFO | |
WARNING | |
ERROR | |
FATAL | |
_NSEVERITIES |
Definition at line 73 of file Logger.h.
BOOST_NOINLINE std::string* logger::check_failed | ( | X const & | x, |
Y const & | y, | ||
char const * | xstr, | ||
char const * | ystr, | ||
char const * | op_str | ||
) |
sinks::text_file_backend::open_handler_type logger::create_or_replace_symlink | ( | boost::weak_ptr< SINK > | weak_ptr, |
std::string && | symlink | ||
) |
Definition at line 171 of file Logger.cpp.
References filename().
Referenced by make_sink().
void logger::debug_timer_new_thread | ( | ThreadId | parent_thread_id | ) |
Call this when a new thread is spawned that will have timers that need to be associated with timers on the parent thread.
Definition at line 721 of file Logger.cpp.
References CHECK, g_duration_tree_map, g_duration_tree_map_mutex, and g_thread_id.
|
inline |
Definition at line 174 of file Logger.h.
References g_any_active_channels.
Referenced by query_state::StdLog::log(), and query_state::StdLog::logCallStack().
|
inline |
std::string logger::filename | ( | char const * | path | ) |
Definition at line 62 of file Logger.cpp.
Referenced by import_export::QueryExporterGDAL::beginExport(), create_or_replace_symlink(), com.omnisci.jdbc.KeyLoader::getDetails_pkcs12(), logger::LogOptions::LogOptions(), logger::JsonEncoder::operator()(), operator<<(), anonymous_namespace{DBHandler.cpp}::path_has_valid_filename(), File_Namespace::removeFile(), logger::Logger::stream(), and to_lower().
boost::log::attributes::current_process_id::value_type::native_type logger::get_native_process_id | ( | boost::log::value_ref< boost::log::attributes::current_process_id::value_type, tag::process_id > const & | pid | ) |
Definition at line 164 of file Logger.cpp.
Referenced by set_formatter().
void logger::init | ( | LogOptions const & | log_opts | ) |
Definition at line 280 of file Logger.cpp.
References _NSEVERITIES, logger::LogOptions::channels_, logger::LogOptions::full_log_dir(), g_any_active_channels, g_min_active_severity, INFO, run_benchmark_import::level, LOG, logger::LogOptions::max_files_, logger::LogOptions::severity_, and logger::LogOptions::severity_clog_.
Referenced by import_export::Detector::Detector(), File_Namespace::FileMgr::getFileInfoForFileId(), Calcite::getInternalSessionProxyPassword(), import_export::Loader::getReplicating(), Geospatial::GeoBase::getTransformation(), File_Namespace::headerCompare(), QueryRunner::QueryRunner::init(), CommandLineOptions::init_logging(), File_Namespace::GlobalFileMgr::isAllocationCapped(), import_export::Loader::Loader(), main(), ColumnarResults::mergeResults(), ResultSetManager::reduce(), Executor::reduceMultiDeviceResultSets(), FixedLengthEncoder< T, V >::updateStatsEncoded(), and NoneEncoder< T >::updateStatsEncoded().
void logger::logAndEraseDurationTree | ( | std::string * | json_str | ) |
Definition at line 676 of file Logger.cpp.
References CHECK, g_duration_tree_map, g_duration_tree_map_mutex, g_thread_id, logger::Logger::Logger(), and logger::JsonEncoder::str().
Referenced by logger::DebugTimer::stop(), and logger::DebugTimer::stopAndGetJson().
boost::shared_ptr<FILE_SINK> logger::make_sink | ( | LogOptions const & | log_opts, |
boost::filesystem::path const & | full_log_dir, | ||
TAG const | tag | ||
) |
Definition at line 225 of file Logger.cpp.
References logger::LogOptions::auto_flush_, create_or_replace_symlink(), logger::LogOptions::file_name_pattern_, INFO, logger::LogOptions::max_files_, logger::LogOptions::min_free_space_, replace_braces(), logger::LogOptions::rotate_daily_, logger::LogOptions::rotation_size_, logger::LogOptions::severity_, and logger::LogOptions::symlink_.
boost::shared_ptr<CONSOLE_SINK> logger::make_sink | ( | LogOptions const & | log_opts | ) |
Definition at line 266 of file Logger.cpp.
References logger::LogOptions::severity_clog_.
Definition at line 531 of file Logger.cpp.
References run_benchmark_import::args, g_duration_tree_map, g_duration_tree_map_mutex, g_enable_debug_timer, and g_thread_id.
boost::log::formatting_ostream& logger::operator<< | ( | boost::log::formatting_ostream & | strm, |
boost::log::to_log_manip< Channel, tag::channel > const & | manip | ||
) |
boost::log::formatting_ostream& logger::operator<< | ( | boost::log::formatting_ostream & | strm, |
boost::log::to_log_manip< Severity, tag::severity > const & | manip | ||
) |
std::ostream& logger::operator<< | ( | std::ostream & | out, |
Channels const & | channels | ||
) |
std::ostream& logger::operator<< | ( | std::ostream & | out, |
Severity const & | sev | ||
) |
std::ostream& logger::operator<< | ( | std::ostream & | os, |
Duration const & | duration | ||
) |
Definition at line 543 of file Logger.cpp.
References logger::Duration::depth_, logger::Duration::file_, filename(), logger::Duration::line_, logger::Duration::name_, logger::Duration::relative_start_time(), and logger::Duration::value().
std::ostream& logger::operator<< | ( | std::ostream & | os, |
DurationTree const & | duration_tree | ||
) |
Definition at line 549 of file Logger.cpp.
References logger::DurationTree::depth_, logger::DurationTree::durations(), and logger::DurationTree::thread_id_.
boost::log::record_ostream& logger::operator<< | ( | boost::log::record_ostream & | os, |
DurationTreeMap::const_reference | kv_pair | ||
) |
std::istream& logger::operator>> | ( | std::istream & | in, |
Channels & | channels | ||
) |
Definition at line 334 of file Logger.cpp.
References ChannelNames, parse_ast::end, parse_ast::line, and logger::anonymous_namespace{Logger.cpp}::unquote().
std::istream& logger::operator>> | ( | std::istream & | in, |
Severity & | sev | ||
) |
Definition at line 363 of file Logger.cpp.
References SeverityNames, and logger::anonymous_namespace{Logger.cpp}::unquote().
std::string logger::replace_braces | ( | std::string const & | str, |
TAG const | tag | ||
) |
Definition at line 153 of file Logger.cpp.
References ChannelNames, and SeverityNames.
Referenced by make_sink().
void logger::set_formatter | ( | SINK & | sink | ) |
Definition at line 206 of file Logger.cpp.
References get_native_process_id().
void logger::set_once_fatal_func | ( | FatalFunc | fatal_func | ) |
Definition at line 307 of file Logger.cpp.
References g_fatal_func.
Referenced by QueryRunner::QueryRunner::QueryRunner().
void logger::shutdown | ( | ) |
Definition at line 314 of file Logger.cpp.
Referenced by heartbeat(), DBHandler::max_bytes_for_thrift(), TestProcessSignalHandler::shutdownSubsystemsAndExit(), startMapdServer(), and logger::LogShutdown::~LogShutdown().
ThreadId logger::thread_id | ( | ) |
Definition at line 732 of file Logger.cpp.
References g_thread_id.
Referenced by import_export::import_thread_delimited(), import_export::import_thread_shapefile(), import_export::Importer::importDelimited(), import_export::Importer::importGDAL(), Executor::launchKernels(), query_state::StdLog::log(), StringDictionary::populate_string_array_ids(), Parser::InsertIntoTableAsSelectStmt::populateData(), PerfectJoinHashTable::reify(), OverlapsJoinHashTable::reifyWithLayout(), BaselineJoinHashTable::reifyWithLayout(), and logger::Logger::stream().
Definition at line 63 of file Logger.h.
Referenced by operator<<(), operator>>(), replace_braces(), and logger::LogOptions::set_options().
constexpr std::array<char, 3> logger::ChannelSymbols {'R', 'P', 'A'} |
Definition at line 65 of file Logger.h.
Referenced by operator<<().
bool logger::g_any_active_channels {false} |
Definition at line 277 of file Logger.cpp.
Referenced by fast_logging_check(), and init().
DurationTreeMap logger::g_duration_tree_map |
Definition at line 526 of file Logger.cpp.
Referenced by debug_timer_new_thread(), logAndEraseDurationTree(), newDuration(), and logger::EraseDurationTrees::operator()().
std::mutex logger::g_duration_tree_map_mutex |
Definition at line 525 of file Logger.cpp.
Referenced by debug_timer_new_thread(), logAndEraseDurationTree(), and newDuration().
std::atomic<FatalFunc> logger::g_fatal_func {nullptr} |
Definition at line 259 of file Logger.cpp.
Referenced by set_once_fatal_func(), and logger::Logger::~Logger().
std::once_flag logger::g_fatal_func_flag |
Definition at line 260 of file Logger.cpp.
Referenced by logger::Logger::~Logger().
Severity logger::g_min_active_severity {Severity::FATAL} |
Definition at line 278 of file Logger.cpp.
Referenced by fast_logging_check(), and init().
std::atomic<ThreadId> logger::g_next_thread_id {0} |
Definition at line 527 of file Logger.cpp.
ThreadId thread_local const logger::g_thread_id = g_next_thread_id++ |
Definition at line 528 of file Logger.cpp.
Referenced by debug_timer_new_thread(), logAndEraseDurationTree(), newDuration(), and thread_id().
constexpr std::array<char const*, 8> logger::SeverityNames |
Definition at line 85 of file Logger.h.
Referenced by operator<<(), operator>>(), replace_braces(), and logger::LogOptions::set_options().
constexpr std::array<char, 8> logger::SeveritySymbols {'4', '3', '2', '1', 'I', 'W', 'E', 'F'} |
Definition at line 94 of file Logger.h.
Referenced by operator<<().