FS#9788: Include timestamp in logf filename (Yoshihisa Uchida)
For example, logf_202007071157.txt Change-Id: Ia50c0ca67772e3d26b49dd8e1a3519816e5211c6
This commit is contained in:
parent
52325a7c01
commit
8fc5e33ae1
1 changed files with 12 additions and 0 deletions
|
@ -221,6 +221,10 @@ bool logfdisplay(void)
|
|||
bool logfdump(void)
|
||||
{
|
||||
int fd;
|
||||
#if CONFIG_RTC
|
||||
struct tm *nowtm;
|
||||
char fname[MAX_PATH];
|
||||
#endif
|
||||
|
||||
splashf(HZ, "Log File Dumped");
|
||||
|
||||
|
@ -231,7 +235,15 @@ bool logfdump(void)
|
|||
|
||||
logfenabled = false;
|
||||
|
||||
#if CONFIG_RTC
|
||||
nowtm = get_time();
|
||||
snprintf(fname, MAX_PATH, "%s/logf_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR,
|
||||
nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday,
|
||||
nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec);
|
||||
fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC);
|
||||
#else
|
||||
fd = open(ROCKBOX_DIR "/logf.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);
|
||||
#endif
|
||||
if(-1 != fd) {
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Reference in a new issue