add Model::get_logger()

This commit is contained in:
Tomasz Sowa 2022-08-01 03:58:07 +02:00
parent 8373f9e9d8
commit c54a5bed05
2 changed files with 15 additions and 6 deletions

View File

@ -1163,16 +1163,24 @@ void Model::log_table_name_with_field(const wchar_t * db_field_name, bool put_sc
}
void Model::put_to_log(const wchar_t * str)
pt::Log * Model::get_logger()
{
if( model_connector )
{
pt::Log * log = model_connector->get_logger();
return model_connector->get_logger();
}
if( log )
{
(*log) << str << pt::Log::logend;
}
return nullptr;
}
void Model::put_to_log(const wchar_t * str)
{
pt::Log * log = get_logger();
if( log )
{
(*log) << str << pt::Log::logend;
}
}

View File

@ -1589,6 +1589,7 @@ protected:
virtual bool is_empty_field(const wchar_t * value);
virtual bool is_the_same_field(const wchar_t * field1, const wchar_t * field2);
virtual pt::Log * get_logger();
virtual void put_to_log(const wchar_t * str);
virtual void put_fields_to_log(pt::Log & log, const wchar_t * db_field_name, const wchar_t * flat_field_name);