|
@@ -165,7 +165,7 @@ public:
|
|
ss << "*";
|
|
ss << "*";
|
|
ss << KernelInfo::term(_var);
|
|
ss << KernelInfo::term(_var);
|
|
}
|
|
}
|
|
- if( not _value == -1) {
|
|
|
|
|
|
+ if( not KernelInfo::term(_value).empty()) {
|
|
ss << "=" << KernelInfo::term(_value);
|
|
ss << "=" << KernelInfo::term(_value);
|
|
}
|
|
}
|
|
if(not KernelInfo::term(_tgt_model).empty()) {
|
|
if(not KernelInfo::term(_tgt_model).empty()) {
|
|
@@ -245,6 +245,29 @@ public:
|
|
void set_kernel_info(const KernelInfo& info)
|
|
void set_kernel_info(const KernelInfo& info)
|
|
{ _kernel_info = info; }
|
|
{ _kernel_info = info; }
|
|
|
|
|
|
|
|
+ std::string to_string(artis::utils::DateFormat date_format =
|
|
|
|
+ artis::utils::DATE_FORMAT_EXTENDED) const
|
|
|
|
+ {
|
|
|
|
+ std::ostringstream ss;
|
|
|
|
+ ss << (from_kernel() ? "KERNEL" : "TRACE ");
|
|
|
|
+ if (get_time() != Time::null) {
|
|
|
|
+ ss << "(" << utils::DateTime::toJulianDayFmt(get_time(),
|
|
|
|
+ date_format)
|
|
|
|
+ << ")";
|
|
|
|
+ }
|
|
|
|
+ ss << ": ";
|
|
|
|
+ ss << "<" + TraceTypesStr[get_type()] + ">";
|
|
|
|
+ ss << " " << get_model_name();
|
|
|
|
+ if (not get_kernel_info().empty()) {
|
|
|
|
+ ss << get_kernel_info().to_string();
|
|
|
|
+ }
|
|
|
|
+ if (not get_comment().empty()) {
|
|
|
|
+ ss << " => " << get_comment();
|
|
|
|
+ }
|
|
|
|
+ return ss.str();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
private:
|
|
private:
|
|
std::string _model_name;
|
|
std::string _model_name;
|
|
typename Time::type _time;
|
|
typename Time::type _time;
|
|
@@ -328,22 +351,7 @@ public:
|
|
for (typename TraceElements < Time >::const_iterator it =
|
|
for (typename TraceElements < Time >::const_iterator it =
|
|
TraceElements < Time >::begin();
|
|
TraceElements < Time >::begin();
|
|
it != TraceElements < Time >::end(); ++it) {
|
|
it != TraceElements < Time >::end(); ++it) {
|
|
- ss << (it->from_kernel() ? "KERNEL" : "TRACE ");
|
|
|
|
- if (it->get_time() != Time::null) {
|
|
|
|
- ss << "(" << utils::DateTime::toJulianDayFmt(it->get_time(),
|
|
|
|
- date_format)
|
|
|
|
- << ")";
|
|
|
|
- }
|
|
|
|
- ss << ": ";
|
|
|
|
- ss << "<" + TraceTypesStr[it->get_type()] + ">";
|
|
|
|
- ss << " " << it->get_model_name();
|
|
|
|
- if (not it->get_kernel_info().empty()) {
|
|
|
|
- ss << it->get_kernel_info().to_string();
|
|
|
|
- }
|
|
|
|
- if (not it->get_comment().empty()) {
|
|
|
|
- ss << " => " << it->get_comment();
|
|
|
|
- }
|
|
|
|
- ss << std::endl;
|
|
|
|
|
|
+ ss << it->to_string(date_format) << std::endl;
|
|
}
|
|
}
|
|
return ss.str();
|
|
return ss.str();
|
|
}
|
|
}
|
|
@@ -359,10 +367,7 @@ public:
|
|
static Trace& trace()
|
|
static Trace& trace()
|
|
{
|
|
{
|
|
std::call_once(_flag, [] ()
|
|
std::call_once(_flag, [] ()
|
|
- { _instance.reset(new Trace());
|
|
|
|
-// artis::utils::KernelInfo::elt_dictionary = std::map < std::string, int >();
|
|
|
|
-// artis::utils::KernelInfo::elt_names = std::vector < std::string > ();
|
|
|
|
- }
|
|
|
|
|
|
+ { _instance.reset(new Trace()); }
|
|
);
|
|
);
|
|
return *_instance;
|
|
return *_instance;
|
|
}
|
|
}
|