Changeset 1144 in MondoRescue for branches/stable/mondo/src/include/my-stuff.h


Ignore:
Timestamp:
Feb 12, 2007, 10:54:22 AM (13 years ago)
Author:
Bruno Cornec
Message:

log_trace (unused) and log_trace_msg removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/include/my-stuff.h

    r1131 r1144  
    2626#include <stdio.h>
    2727#include "mr_mem.h"
     28#include "mr_msg.h"
    2829
    2930#if !defined(bool) && !defined(__cplusplus)
     
    100101 */
    101102#define MDSTAT_FILE "/proc/mdstat"
    102 
    103 /**
    104  * @bug Apparently unused.
    105  */
    106 #define MONDO_TRACEFILE "/var/log/mondo-tracefile.log"
    107103
    108104#undef assert
     
    245241 * Log the file, line, Mondo error message, and OS error message (errno).
    246242 */
    247 #define log_OS_error(x) {log_msg(0, "%s, line %ld: %s (%s)", __FILE__, __LINE__, x, strerror(errno));}
     243#define log_OS_error(x) {mr_msg(1, "%s, line %ld: %s (%s)", __FILE__, __LINE__, x, strerror(errno));}
    248244
    249245/**
     
    255251 * close() @p x and log a message if it fails.
    256252 */
    257 #define paranoid_close(x) {if(close(x)) {log_msg(5, "close err");} x=-999; }
     253#define paranoid_close(x) {if(close(x)) {mr_msg(5, "close err");} x=-999; }
    258254
    259255/**
    260256 * fclose() @p x and log a message if it fails.
    261257 */
    262 #define paranoid_fclose(x) {if(fclose(x)) {log_msg(5, "fclose err");} x=NULL; }
     258#define paranoid_fclose(x) {if(fclose(x)) {mr_msg(5, "fclose err");} x=NULL; }
    263259
    264260/**
    265261 * pclose() @p x and log a message if it fails.
    266262 */
    267 #define paranoid_pclose(x) {if(pclose(x)) {log_msg(5, "pclose err");} x=NULL; }
     263#define paranoid_pclose(x) {if(pclose(x)) {mr_msg(5, "pclose err");} x=NULL; }
    268264
    269265/**
    270266 * Run the command @p x and log it if it fails.
    271267 */
    272 #define paranoid_system(x) {if(system(x)) log_msg(4, x); }
     268#define paranoid_system(x) {if(system(x)) mr_msg(4, x); }
    273269
    274270/**
     
    354350
    355351/**
    356  * Compatibility define to change log_it() calls to log_debug_msg() calls.
    357  */
    358 #define log_it(format, args...) log_debug_msg(2, __FILE__, __FUNCTION__, __LINE__, format, ## args)
    359 
    360 /**
    361  * Macro to log a message along with file, line, and function information.
    362  */
    363 #define log_msg(level, format, args...) log_debug_msg(level, __FILE__, __FUNCTION__, __LINE__, format, ## args)
     352 * Shorter log command
     353 */
     354#define log_it(format, args...) mr_msg(2, format, ## args)
    364355
    365356#define DEFAULT_DVD_DISK_SIZE 4380  ///< The default size (in MB) of a DVD disk, unless the user says otherwise.
Note: See TracChangeset for help on using the changeset viewer.