Merge branch 'master' of http://192.168.100.140:8099/sane/code_device
This commit is contained in:
commit
cfb8957582
|
@ -37,6 +37,7 @@
|
||||||
|
|
||||||
|
|
||||||
extern std::string g_scanner_path; // Ending with '\\'
|
extern std::string g_scanner_path; // Ending with '\\'
|
||||||
|
static std::string log_divider("=========================================================================\n");
|
||||||
|
|
||||||
class log_cls
|
class log_cls
|
||||||
{
|
{
|
||||||
|
@ -58,12 +59,7 @@ class log_cls
|
||||||
if (file_)
|
if (file_)
|
||||||
{
|
{
|
||||||
fseek(file_, 0, SEEK_END);
|
fseek(file_, 0, SEEK_END);
|
||||||
if (ftell(file_))
|
if (ftell(file_) == 0)
|
||||||
{
|
|
||||||
std::string sep("\n\n\n============================\n");
|
|
||||||
fwrite(sep.c_str(), 1, sep.length(), file_);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
unsigned char bom[] = { 0x0ef, 0x0bb, 0x0bf };
|
unsigned char bom[] = { 0x0ef, 0x0bb, 0x0bf };
|
||||||
fwrite(bom, sizeof(bom), 1, file_);
|
fwrite(bom, sizeof(bom), 1, file_);
|
||||||
|
@ -71,6 +67,7 @@ class log_cls
|
||||||
|
|
||||||
std::string now(g_time_tag + hg_log::current_time() + g_time_tag);
|
std::string now(g_time_tag + hg_log::current_time() + g_time_tag);
|
||||||
now += truncate ? " trcated.\n" : " started.\n";
|
now += truncate ? " trcated.\n" : " started.\n";
|
||||||
|
now.insert(0, log_divider);
|
||||||
fwrite(now.c_str(), 1, now.length(), file_);
|
fwrite(now.c_str(), 1, now.length(), file_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,6 +664,7 @@ extern "C"
|
||||||
{
|
{
|
||||||
std::string now(log_cls::g_time_tag + hg_log::current_time() + log_cls::g_time_tag + " exited.\n");
|
std::string now(log_cls::g_time_tag + hg_log::current_time() + log_cls::g_time_tag + " exited.\n");
|
||||||
log(now.c_str());
|
log(now.c_str());
|
||||||
|
log((log_divider + "\n\n\n\n").c_str());
|
||||||
}
|
}
|
||||||
void log(int level, const char* info)
|
void log(int level, const char* info)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue