paths: Allow customizing log file extension
If the file contents is JSON, it would be nice to have matching extension. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
904a1c3271
commit
d8d1cc520b
@ -113,12 +113,13 @@ class LogPaths(object):
|
|||||||
makedirs(path)
|
makedirs(path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def log_file(self, arch, log_name, create_dir=True):
|
def log_file(self, arch, log_name, create_dir=True, ext=None):
|
||||||
|
ext = ext or "log"
|
||||||
arch = arch or "global"
|
arch = arch or "global"
|
||||||
if log_name.endswith(".log"):
|
if log_name.endswith(".log"):
|
||||||
log_name = log_name[:-4]
|
log_name = log_name[:-4]
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
self.topdir(arch, create_dir=create_dir), "%s.%s.log" % (log_name, arch)
|
self.topdir(arch, create_dir=create_dir), "%s.%s.%s" % (log_name, arch, ext)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user