summaryrefslogtreecommitdiffstats
path: root/loader2/loadermisc.c
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2005-08-13 00:52:40 +0000
committerChris Lumens <clumens@redhat.com>2005-08-13 00:52:40 +0000
commit26091625f3cf24dc0ba5bf655a83a868c5b20e89 (patch)
treea492c91713966c8050f0cee47cad79e87d15dbea /loader2/loadermisc.c
parenta96d25d6bdae5703ff8d9ee5993d9942f2a6a48d (diff)
downloadanaconda-26091625f3cf24dc0ba5bf655a83a868c5b20e89.tar.gz
anaconda-26091625f3cf24dc0ba5bf655a83a868c5b20e89.tar.xz
anaconda-26091625f3cf24dc0ba5bf655a83a868c5b20e89.zip
Support logging levels in the loader just like in the python parts of the
installer. Also make the output look the same. This isn't going to be nearly as sophisticated as the python logging module, but it will at least behave similarly with command line options.
Diffstat (limited to 'loader2/loadermisc.c')
-rw-r--r--loader2/loadermisc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/loader2/loadermisc.c b/loader2/loadermisc.c
index eab3dbb70..d73305b26 100644
--- a/loader2/loadermisc.c
+++ b/loader2/loadermisc.c
@@ -37,7 +37,7 @@ int copyFileFd(int infd, char * dest) {
outfd = open(dest, O_CREAT | O_RDWR, 0666);
if (outfd < 0) {
- logMessage("failed to open %s: %s", dest, strerror(errno));
+ logMessage(ERROR, "failed to open %s: %s", dest, strerror(errno));
return 1;
}
@@ -60,7 +60,7 @@ int copyFile(char * source, char * dest) {
infd = open(source, O_RDONLY);
if (infd < 0) {
- logMessage("failed to open %s: %s", source, strerror(errno));
+ logMessage(ERROR, "failed to open %s: %s", source, strerror(errno));
return 1;
}
@@ -224,13 +224,13 @@ int totalMemory(void) {
fd = open("/proc/meminfo", O_RDONLY);
if (fd < 0) {
- logMessage("failed to open /proc/meminfo: %s", strerror(errno));
+ logMessage(ERROR, "failed to open /proc/meminfo: %s", strerror(errno));
return 0;
}
bytesRead = read(fd, buf, sizeof(buf) - 1);
if (bytesRead < 0) {
- logMessage("failed to read from /proc/meminfo: %s", strerror(errno));
+ logMessage(ERROR, "failed to read from /proc/meminfo: %s", strerror(errno));
close(fd);
return 0;
}
@@ -252,7 +252,7 @@ int totalMemory(void) {
while (!isdigit(*start) && *start) start++;
if (!*start) {
- logMessage("no number appears after MemTotal tag");
+ logMessage(WARNING, "no number appears after MemTotal tag");
return 0;
}
@@ -263,7 +263,7 @@ int totalMemory(void) {
}
}
- logMessage("%d kB are available", total);
+ logMessage(INFO, "%d kB are available", total);
return total;
}