Changeset 1625 in MondoRescue


Ignore:
Timestamp:
Sep 9, 2007, 1:00:49 AM (17 years ago)
Author:
Bruno Cornec
Message:

remove g_loglevel and replaced with mr_conf->log_level

Location:
branches/stable/mondo/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-fork.c

    r1609 r1625  
    77#include "mr_str.h"
    88#include "mr_gettext.h"
     9#include "mr_conf.h"
    910
    1011#include "mondostructures.h"
     
    2324extern char *MONDO_LOGFILE;
    2425pid_t g_buffer_pid = 0;
    25 
     26extern struct mr_ar_conf *mr_conf = NULL;
    2627
    2728/**
     
    178179 * Run a program and log its output (stdout and stderr) to the logfile.
    179180 * @param program The program to run. Passed to the shell, so you can use pipes etc.
    180  * @param debug_level If @p g_loglevel is higher than this, do not log the output.
     181 * @param debug_level If @p log_level is higher than this, do not log the output.
    181182 * @return The exit code of @p program (depends on the command, but 0 almost always indicates success).
    182183 */
     
    205206    }
    206207
    207     if (debug_level <= g_loglevel) {
     208    if (debug_level <= mr_conf->log_level) {
    208209        log_if_success = TRUE;
    209210        log_if_failure = TRUE;
  • branches/stable/mondo/src/common/libmondo-tools-EXT.h

    r1183 r1625  
    1515#endif
    1616extern int some_basic_system_sanity_checks(void);
    17 
    18 
    19 extern int g_loglevel;
    2017
    2118
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1609 r1625  
    6464char *g_tmpfs_mountpt = NULL;
    6565char *g_magicdev_command = NULL;
    66 
    67 /**
    68  * The default maximum level to log messages at or below.
    69  */
    70 int g_loglevel = DEFAULT_DEBUG_LEVEL;
    7166
    7267/* @} - end of globalGroup */
  • branches/stable/mondo/src/include/my-stuff.h

    r1594 r1625  
    294294#define log_it(format, args...) mr_msg(2, format, ## args)
    295295
    296 #define DEFAULT_DEBUG_LEVEL 4   ///< By default, don't log messages with a loglevel higher than this.
    297 #define DEFAULT_MR_LOGLEVEL 4
    298 
    299296#define SZ_NTFSPROG_VOLSIZE "1048576"   // was 4096
    300297#define NTFSPROG_PARAMS "-z0 -V" SZ_NTFSPROG_VOLSIZE " -o -b -d -g1"
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1609 r1625  
    1919#include "mr_msg.h"
    2020#include "mr_gettext.h"
     21#include "mr_conf.h"
    2122
    2223//static char cvsid[] = "$Id$";
    2324
    24 extern int g_loglevel;
    2525extern bool g_text_mode;
    2626extern char g_startdir[MAX_STR_LEN];    ///< ????? @bug ?????
     
    2828extern char g_tmpfs_mountpt[MAX_STR_LEN];
    2929extern bool g_sigpipe;
     30
     31extern struct mr_ar_conf *mr_conf = NULL;
    3032
    3133/*@ file pointer **************************************************/
     
    220222    }
    221223    if (flag_set['K']) {
    222         g_loglevel = atoi(flag_val['K']);
    223         if (g_loglevel < 3) {
    224             g_loglevel = 3;
     224        mr_conf->log_level = atoi(flag_val['K']);
     225        if (mr_conf->log_level < 3) {
     226            mr_conf->log_level = 3;
    225227        }
    226228    }
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1594 r1625  
    4949extern char *g_magicdev_command;
    5050extern t_bkptype g_backup_media_type;
    51 extern int g_loglevel;
    5251
    5352extern char *get_uname_m(void);
     
    501500
    502501    if (argc == 4 && !strcmp(argv[1], "getfattr")) {
    503         g_loglevel = 10;
     502        mr_conf->log_level = 10;
    504503        g_text_mode = TRUE;
    505504        setup_newt_stuff();
     
    513512    }
    514513    if (argc == 4 && !strcmp(argv[1], "setfattr")) {
    515         g_loglevel = 10;
     514        mr_conf->log_level = 10;
    516515        g_text_mode = TRUE;
    517516        setup_newt_stuff();
     
    520519
    521520    if (argc == 3 && !strcmp(argv[1], "wildcards")) {
    522         g_loglevel = 10;
     521        mr_conf->log_level = 10;
    523522        g_text_mode = TRUE;
    524523        setup_newt_stuff();
     
    530529
    531530    if (argc == 4 && !strcmp(argv[1], "getfacl")) {
    532         g_loglevel = 10;
     531        mr_conf->log_level = 10;
    533532        g_text_mode = TRUE;
    534533        setup_newt_stuff();
     
    542541    }
    543542    if (argc == 4 && !strcmp(argv[1], "setfacl")) {
    544         g_loglevel = 10;
     543        mr_conf->log_level = 10;
    545544        g_text_mode = TRUE;
    546545        setup_newt_stuff();
     
    549548
    550549    if (argc > 2 && !strcmp(argv[1], "find-cd")) {
    551         g_loglevel = 10;
     550        mr_conf->log_level = 10;
    552551        g_text_mode = TRUE;
    553552        setup_newt_stuff();
     
    569568
    570569    if (argc > 2 && !strcmp(argv[1], "find-dvd")) {
    571         g_loglevel = 10;
     570        mr_conf->log_level = 10;
    572571        g_text_mode = TRUE;
    573572        setup_newt_stuff();
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1621 r1625  
    3232#include "mondo-rstr-tools-EXT.h"
    3333
     34#define DEFAULT_MR_LOGLEVEL 4
     35
    3436extern void twenty_seconds_til_yikes(void);
     37extern struct mr_ar_conf *mr_conf = NULL;
    3538
    3639
     
    10131016    struct s_node *node = NULL;
    10141017
    1015     old_loglevel = g_loglevel;
     1018    old_loglevel = mr_conf->log_level;
    10161019    ubuf = &the_utime_buf;
    10171020    assert(bkpinfo != NULL);
     
    10761079    if (biggiestruct.use_ntfsprog)  // if it's an NTFS device
    10771080    {
    1078         g_loglevel = 4;
     1081        mr_conf->log_level = 4;
    10791082        use_ntfsprog_hack = TRUE;
    10801083        mr_msg(2,
     
    12411244    }
    12421245    paranoid_fclose(fout);
    1243     g_loglevel = old_loglevel;
     1246    mr_conf->log_level = old_loglevel;
    12441247
    12451248    if (use_ntfsprog_hack) {
     
    13171320    ubuf = &the_utime_buf;
    13181321
    1319     old_loglevel = g_loglevel;
     1322    old_loglevel = mr_conf->log_level;
    13201323    assert(bkpinfo != NULL);
    13211324    assert(orig_bf_fname != NULL);
     
    13651368
    13661369    if (use_ntfsprog) {
    1367         g_loglevel = 4;
     1370        mr_conf->log_level = 4;
    13681371        mr_asprintf(&outfile_fname, orig_bf_fname);
    13691372        use_ntfsprog_hack = TRUE;
     
    15071510    }
    15081511
    1509     g_loglevel = old_loglevel;
     1512    mr_conf->log_level = old_loglevel;
    15101513    return (retval);
    15111514}
     
    28172820    }
    28182821
    2819     g_loglevel = DEFAULT_MR_LOGLEVEL;
     2822    mr_conf->log_level = DEFAULT_MR_LOGLEVEL;
    28202823
    28212824/* Configure global variables */
     
    29262929    }
    29272930
    2928     g_loglevel = DEFAULT_MR_LOGLEVEL;
     2931    mr_conf->log_level = DEFAULT_MR_LOGLEVEL;
    29292932    if (argc == 3 && strcmp(argv[1], "--echo-to-screen") == 0) {
    29302933        fout = fopen("/tmp/out.txt", "w");
     
    29582961
    29592962    if (argc == 5 && strcmp(argv[1], "--common") == 0) {
    2960         g_loglevel = 6;
     2963        mr_conf->log_level = 6;
    29612964        filelist = load_filelist(argv[2]);
    29622965        if (!filelist) {
     
    29862989    if (argc == 5 && strcmp(argv[1], "--copy") == 0) {
    29872990        mr_msg(1, "SCORE");
    2988         g_loglevel = 10;
     2991        mr_conf->log_level = 10;
    29892992        if (strstr(argv[2], "save")) {
    29902993            mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
Note: See TracChangeset for help on using the changeset viewer.