AP_Logger: factor out an ensure_log_directory_exists method
This commit is contained in:
parent
ab2eb6185f
commit
66f8359c6b
@ -58,10 +58,8 @@ AP_Logger_File::AP_Logger_File(AP_Logger &front,
|
||||
}
|
||||
|
||||
|
||||
void AP_Logger_File::Init()
|
||||
void AP_Logger_File::ensure_log_directory_exists()
|
||||
{
|
||||
AP_Logger_Backend::Init();
|
||||
// create the log directory if need be
|
||||
int ret;
|
||||
struct stat st;
|
||||
|
||||
@ -78,6 +76,14 @@ void AP_Logger_File::Init()
|
||||
if (ret == -1 && errno != EEXIST) {
|
||||
printf("Failed to create log directory %s : %s\n", _log_directory, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
void AP_Logger_File::Init()
|
||||
{
|
||||
AP_Logger_Backend::Init();
|
||||
|
||||
// create the log directory if need be
|
||||
ensure_log_directory_exists();
|
||||
|
||||
// determine and limit file backend buffersize
|
||||
uint32_t bufsize = _front._params.file_bufsize;
|
||||
|
@ -98,6 +98,8 @@ private:
|
||||
int64_t disk_space_avail();
|
||||
int64_t disk_space();
|
||||
|
||||
void ensure_log_directory_exists();
|
||||
|
||||
bool file_exists(const char *filename) const;
|
||||
bool log_exists(const uint16_t lognum) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user