Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development Java (http://www.linux-archive.org/fedora-development-java/)
-   -   Don't open anaconda logs for appending. (http://www.linux-archive.org/fedora-development-java/498335-dont-open-anaconda-logs-appending.html)

Chris Lumens 03-07-2011 05:10 PM

Don't open anaconda logs for appending.
 
This prevents live installs from having log files that just grow and
grow every time the user restarts liveinst.
---
pyanaconda/anaconda_log.py | 2 +-
pyanaconda/yuminstall.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index 04dea8d..9be016e 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -167,7 +167,7 @@ class AnacondaLog:
fmtStr=ENTRY_FORMAT,
autoLevel=False):
if isinstance(file, types.StringTypes):
- logfileHandler = logging.FileHandler(file)
+ logfileHandler = logging.FileHandler(file, "w")
else:
logfileHandler = logging.StreamHandler(file)

diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index fe88586..dec146e 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -741,7 +741,7 @@ class AnacondaYum(yum.YumBase):

import yum.logginglevels

- file_handler = logging.FileHandler("/tmp/yum.log")
+ file_handler = logging.FileHandler("/tmp/yum.log", "w")
file_formatter = logging.Formatter("[%(asctime)s] %(levelname)-8s: %(message)s")
file_handler.setFormatter(file_formatter)

--
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Ales Kozumplik 03-08-2011 06:11 AM

Don't open anaconda logs for appending.
 
On 03/07/2011 07:10 PM, Chris Lumens wrote:

This prevents live installs from having log files that just grow and
grow every time the user restarts liveinst.
---


Is that something we don't want? At least we have a way to find out when
they are trying to claim they did nothing extraordinary to get those
irreproducible tracebacks.


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

David Lehman 03-08-2011 02:17 PM

Don't open anaconda logs for appending.
 
On Mon, 2011-03-07 at 13:10 -0500, Chris Lumens wrote:
> This prevents live installs from having log files that just grow and
> grow every time the user restarts liveinst.

I would prefer if we put a big stamp/header in each log at the start of
each run. That way we can see what all has been done and also have a
good way to separate the data from various runs.

Dave

> ---
> pyanaconda/anaconda_log.py | 2 +-
> pyanaconda/yuminstall.py | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
> index 04dea8d..9be016e 100644
> --- a/pyanaconda/anaconda_log.py
> +++ b/pyanaconda/anaconda_log.py
> @@ -167,7 +167,7 @@ class AnacondaLog:
> fmtStr=ENTRY_FORMAT,
> autoLevel=False):
> if isinstance(file, types.StringTypes):
> - logfileHandler = logging.FileHandler(file)
> + logfileHandler = logging.FileHandler(file, "w")
> else:
> logfileHandler = logging.StreamHandler(file)
>
> diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
> index fe88586..dec146e 100644
> --- a/pyanaconda/yuminstall.py
> +++ b/pyanaconda/yuminstall.py
> @@ -741,7 +741,7 @@ class AnacondaYum(yum.YumBase):
>
> import yum.logginglevels
>
> - file_handler = logging.FileHandler("/tmp/yum.log")
> + file_handler = logging.FileHandler("/tmp/yum.log", "w")
> file_formatter = logging.Formatter("[%(asctime)s] %(levelname)-8s: %(message)s")
> file_handler.setFormatter(file_formatter)
>


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 09:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.