Exception: make source location print-out optional
[lttng-tools.git] / src / common / random.cpp
index ba9d937ba32b95f43f877348ac0f358ea9c7e071..178a228c9e74591731f3f947c3f643270e36cd63 100644 (file)
@@ -22,7 +22,8 @@
 #endif
 
 #define LTTNG_THROW_RANDOM_PRODUCTION_ERROR(msg) \
-       throw lttng::random::production_error(msg, __FILE__, __func__, __LINE__)
+       throw lttng::random::production_error(   \
+               msg, lttng::source_location(__FILE__, __func__, __LINE__))
 
 namespace {
 /* getrandom is available in Linux >= 3.17. */
@@ -162,10 +163,8 @@ lttng::random::seed_t produce_random_seed_from_urandom()
 } /* namespace */
 
 lttng::random::production_error::production_error(const std::string& msg,
-                                                 const char *file_name,
-                                                 const char *function_name,
-                                                 unsigned int line_number) :
-       lttng::runtime_error(msg, file_name, function_name, line_number)
+                                                 const lttng::source_location& location) :
+       lttng::runtime_error(msg, location)
 {
 }
 
This page took 0.022679 seconds and 4 git commands to generate.