-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Separated log stuff in different files
- Added function to detect the disk space - Fixed bug in parser to find the installation size
- Loading branch information
Showing
11 changed files
with
140 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* Functions to log messages */ | ||
|
||
#include <stdarg.h> | ||
#include <stdio.h> | ||
|
||
#include "install_log.h" | ||
#include "log.h" | ||
|
||
void log_debug(install_info *info, const char *fmt, ...) | ||
{ | ||
va_list ap; | ||
char buf[BUFSIZ]; | ||
|
||
va_start(ap, fmt); | ||
vsprintf(buf, fmt, ap); | ||
va_end(ap); | ||
print_log(info->log, LOG_DEBUG, "%s\n", buf); | ||
} | ||
void log_quiet(install_info *info, const char *fmt, ...) | ||
{ | ||
va_list ap; | ||
char buf[BUFSIZ]; | ||
|
||
va_start(ap, fmt); | ||
vsprintf(buf, fmt, ap); | ||
va_end(ap); | ||
print_log(info->log, LOG_QUIET, "%s\n", buf); | ||
} | ||
void log_normal(install_info *info, const char *fmt, ...) | ||
{ | ||
va_list ap; | ||
char buf[BUFSIZ]; | ||
|
||
va_start(ap, fmt); | ||
vsprintf(buf, fmt, ap); | ||
va_end(ap); | ||
print_log(info->log, LOG_NORMAL, "%s\n", buf); | ||
} | ||
void log_warning(install_info *info, const char *fmt, ...) | ||
{ | ||
va_list ap; | ||
char buf[BUFSIZ]; | ||
|
||
va_start(ap, fmt); | ||
vsprintf(buf, fmt, ap); | ||
va_end(ap); | ||
print_log(info->log, LOG_WARNING, "%s\n", buf); | ||
} | ||
void log_fatal(install_info *info, const char *fmt, ...) | ||
{ | ||
va_list ap; | ||
char buf[BUFSIZ]; | ||
|
||
va_start(ap, fmt); | ||
vsprintf(buf, fmt, ap); | ||
va_end(ap); | ||
print_log(info->log, LOG_FATAL, "%s\n", buf); | ||
abort(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _log_install_h | ||
#define _log_install_h | ||
|
||
/* Functions to log messages */ | ||
|
||
#include "install.h" | ||
|
||
extern void log_debug(install_info *info, const char *fmt, ...); | ||
extern void log_quiet(install_info *info, const char *fmt, ...); | ||
extern void log_normal(install_info *info, const char *fmt, ...); | ||
extern void log_warning(install_info *info, const char *fmt, ...); | ||
extern void log_fatal(install_info *info, const char *fmt, ...); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters