Ejemplo n.º 1
0
 void flush() {
   // once we can determine whether we are in a signal handler, we
   // should add the following assert here:
   // assert(xxxxxx, "can not flush buffer inside signal handler");
   xmlTextStream::flush();
   fflush(output_stream());
   if (has_log_file()) _log_file->flush();
 }
Ejemplo n.º 2
0
void DefaultStream::print_raw(const char* s) {
  JVMSPI_PrintRaw(s);

  // print to log file
  if (LogVMOutput && has_log_file()) {
    OsFile_write(_log_file, s, sizeof(char), jvm_strlen(s));
    //    OsFile_flush(_log_file);
    if (++__charcount == 200000000) {
      OsFile_flush(_log_file);
      JvmPathChar z = 'z';
      JvmPathChar a = 'a';
      __charcount = 0;
      OsFile_close(_log_file);
      _log_file = OsFile_open(__log_name, "w");
      if (__log_name[5] == z) {
        __log_name[5] = a;
      } else {
        __log_name[5]++;
      }
    }
  }


#if !defined(PRODUCT) || ENABLE_PROFILER || ENABLE_TTY_TRACE
  while (true) {
    char ch = *s++;
    if (ch == 0) {
      break;
    } else if (ch == '\n') {
      _position = 0;
    } else {
      _position += 1;
    }
  }
#endif
}
Ejemplo n.º 3
0
 ~defaultStream() { 
   if (has_log_file())  finish_log();
 }
Ejemplo n.º 4
0
 ~DefaultStream() {
   if (has_log_file()) {
     OsFile_close(_log_file);
   }
 }