cvmfs/monitor.cc
static void LogEmergency(string msg) {
  char ctime_buffer[32];

  FILE *fp = fopen((*cache_dir_ + "/stacktrace." + *process_name_).c_str(),
                   "a");
  if (fp) {
    time_t now = time(NULL);
    msg += "\nTimestamp: " + string(ctime_r(&now, ctime_buffer));
    if (fwrite(&msg[0], 1, msg.length(), fp) != msg.length())
      msg += " (failed to report into log file in cache directory)";
    fclose(fp);
  } else {
    msg += " (failed to open log file in cache directory)";
  }
  LogCvmfs(kLogMonitor, kLogSyslogErr, "%s", msg.c_str());
}
/**
 * Log a string to syslog and into $cachedir/stacktrace.
 * We expect ideally nothing to be logged, so that file is created on demand.
 */
Log a string to syslog and into $cachedir/stacktrace.
We expect ideally nothing to be logged, so that file is created on demand.
Log a string to syslog and into $cachedir / stacktrace . We expect ideally nothing to be logged so that file is created on demand .
static void LogEmergency(string msg) {
  char ctime_buffer[32];
  FILE *fp = fopen((*cache_dir_ + "/stacktrace." + *process_name_).c_str(),
                   "a");
  if (fp) {
    time_t now = time(NULL);
    msg += "\nTimestamp: " + string(ctime_r(&now, ctime_buffer));
    if (fwrite(&msg[0], 1, msg.length(), fp) != msg.length())
      msg += " (failed to report into log file in cache directory)";
    fclose(fp);
  } else {
    msg += " (failed to open log file in cache directory)";
  }
  LogCvmfs(kLogMonitor, kLogSyslogErr, "%s", msg.c_str());
}
static void LogEmergency ( string msg ) { char ctime_buffer [ 32 ] ; FILE * fp = fopen ( ( * cache_dir_ + " " + * process_name_ ) . c_str ( ) , " " ) ; if ( fp ) { time_t now = time ( NULL ) ; msg += " \n " + string ( ctime_r ( & now , ctime_buffer ) ) ; if ( fwrite ( & msg [ 0 ] , 1 , msg . length ( ) , fp ) != msg . length ( ) ) msg += " " ; fclose ( fp ) ; } else { msg += " " ; } LogCvmfs ( kLogMonitor , kLogSyslogErr , " " , msg . c_str ( ) ) ; }
Log a string to syslog and into $cachedir/stacktrace.
Log a string to syslog and into $cachedir / stacktrace .