Add timestamps if logging to a file
And try to match appearance of console messages.
This commit is contained in:
parent
fc842d9751
commit
15a65b6166
1 changed files with 2 additions and 1 deletions
|
@ -1876,6 +1876,7 @@ midori_log_to_file (const gchar* log_domain,
|
||||||
{
|
{
|
||||||
FILE* logfile = fopen ((const char*)user_data, "a");
|
FILE* logfile = fopen ((const char*)user_data, "a");
|
||||||
gchar* level_name = "";
|
gchar* level_name = "";
|
||||||
|
time_t timestamp = time (NULL);
|
||||||
|
|
||||||
switch (log_level)
|
switch (log_level)
|
||||||
{
|
{
|
||||||
|
@ -1904,7 +1905,7 @@ midori_log_to_file (const gchar* log_domain,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (logfile, "%s %s: %s\n",
|
fprintf (logfile, "%s%s-%s **: %s\n", asctime (localtime (×tamp)),
|
||||||
log_domain ? log_domain : "Midori", level_name, message);
|
log_domain ? log_domain : "Midori", level_name, message);
|
||||||
fclose (logfile);
|
fclose (logfile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue