hotspot/src/share/vm/logging/log.cpp
changeset 37430 fd743dadef12
parent 37256 568ff1f6631c
child 37461 b5c955296b75
equal deleted inserted replaced
37428:6e724f3d488b 37430:fd743dadef12
   375   Log(gc) log;
   375   Log(gc) log;
   376   LogHandle log_handle(log);
   376   LogHandle log_handle(log);
   377 
   377 
   378   assert(log_handle.is_debug(), "assert");
   378   assert(log_handle.is_debug(), "assert");
   379 
   379 
   380   // Try to log trough a LogHandle.
   380   // Try to log through a LogHandle.
   381   log_handle.debug("%d workers", 3);
   381   log_handle.debug("%d workers", 3);
   382 
   382 
   383   FILE* fp = fopen(log_file.name(), "r");
   383   FILE* fp = fopen(log_file.name(), "r");
   384   assert(fp, "File read error");
   384   assert(fp, "File read error");
   385 
   385 
   406     assert(log_handle.is_debug() == log_is_enabled(Debug, gc), "assert");
   406     assert(log_handle.is_debug() == log_is_enabled(Debug, gc), "assert");
   407     log_warning(logging)("This test doesn't support runs with -Xlog");
   407     log_warning(logging)("This test doesn't support runs with -Xlog");
   408     return;
   408     return;
   409   }
   409   }
   410 
   410 
   411   // Try to log trough a LogHandle. Should fail, since only info is turned on.
   411   // Try to log through a LogHandle. Should fail, since only info is turned on.
   412   log_handle.debug("%d workers", 3);
   412   log_handle.debug("%d workers", 3);
   413 
   413 
   414   // Log a dummy line so that fgets doesn't return NULL because the file is empty.
   414   // Log a dummy line so that fgets doesn't return NULL because the file is empty.
   415   log_info(gc)("Dummy line");
   415   log_info(gc)("Dummy line");
   416 
   416 
   438   LogTarget(Debug, gc) log;
   438   LogTarget(Debug, gc) log;
   439   LogTargetHandle log_handle(log);
   439   LogTargetHandle log_handle(log);
   440 
   440 
   441   assert(log_handle.is_enabled(), "assert");
   441   assert(log_handle.is_enabled(), "assert");
   442 
   442 
   443   // Try to log trough a LogHandle.
   443   // Try to log through a LogHandle.
   444   log_handle.print("%d workers", 3);
   444   log_handle.print("%d workers", 3);
   445 
   445 
   446   FILE* fp = fopen(log_file.name(), "r");
   446   FILE* fp = fopen(log_file.name(), "r");
   447   assert(fp, "File read error");
   447   assert(fp, "File read error");
   448 
   448 
   469     assert(log_handle.is_enabled() == log_is_enabled(Debug, gc), "assert");
   469     assert(log_handle.is_enabled() == log_is_enabled(Debug, gc), "assert");
   470     log_warning(logging)("This test doesn't support runs with -Xlog");
   470     log_warning(logging)("This test doesn't support runs with -Xlog");
   471     return;
   471     return;
   472   }
   472   }
   473 
   473 
   474   // Try to log trough a LogHandle. Should fail, since only info is turned on.
   474   // Try to log through a LogHandle. Should fail, since only info is turned on.
   475   log_handle.print("%d workers", 3);
   475   log_handle.print("%d workers", 3);
   476 
   476 
   477   // Log a dummy line so that fgets doesn't return NULL because the file is empty.
   477   // Log a dummy line so that fgets doesn't return NULL because the file is empty.
   478   log_info(gc)("Dummy line");
   478   log_info(gc)("Dummy line");
   479 
   479