| OLD | NEW | 
|---|
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef V8_LOG_UTILS_H_ | 5 #ifndef V8_LOG_UTILS_H_ | 
| 6 #define V8_LOG_UTILS_H_ | 6 #define V8_LOG_UTILS_H_ | 
| 7 | 7 | 
| 8 #include <stdio.h> | 8 #include <stdio.h> | 
| 9 | 9 | 
| 10 #include <cstdarg> | 10 #include <cstdarg> | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 23 class Log { | 23 class Log { | 
| 24  public: | 24  public: | 
| 25   // Performs process-wide initialization. | 25   // Performs process-wide initialization. | 
| 26   void Initialize(const char* log_file_name); | 26   void Initialize(const char* log_file_name); | 
| 27 | 27 | 
| 28   // Disables logging, but preserves acquired resources. | 28   // Disables logging, but preserves acquired resources. | 
| 29   void stop() { is_stopped_ = true; } | 29   void stop() { is_stopped_ = true; } | 
| 30 | 30 | 
| 31   static bool InitLogAtStart() { | 31   static bool InitLogAtStart() { | 
| 32     return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc || | 32     return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc || | 
| 33            FLAG_log_handles || FLAG_log_suspect || FLAG_log_regexp || | 33            FLAG_log_handles || FLAG_log_suspect || FLAG_ll_prof || | 
| 34            FLAG_ll_prof || FLAG_perf_basic_prof || FLAG_perf_prof || | 34            FLAG_perf_basic_prof || FLAG_perf_prof || | 
| 35            FLAG_log_internal_timer_events || FLAG_prof_cpp; | 35            FLAG_log_internal_timer_events || FLAG_prof_cpp; | 
| 36   } | 36   } | 
| 37 | 37 | 
| 38   // Frees all resources acquired in Initialize and Open... functions. | 38   // Frees all resources acquired in Initialize and Open... functions. | 
| 39   // When a temporary file is used for the log, returns its stream descriptor, | 39   // When a temporary file is used for the log, returns its stream descriptor, | 
| 40   // leaving the file open. | 40   // leaving the file open. | 
| 41   FILE* Close(); | 41   FILE* Close(); | 
| 42 | 42 | 
| 43   // Returns whether logging is enabled. | 43   // Returns whether logging is enabled. | 
| 44   bool IsEnabled() { | 44   bool IsEnabled() { | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 136   Logger* logger_; | 136   Logger* logger_; | 
| 137 | 137 | 
| 138   friend class Logger; | 138   friend class Logger; | 
| 139 }; | 139 }; | 
| 140 | 140 | 
| 141 | 141 | 
| 142 }  // namespace internal | 142 }  // namespace internal | 
| 143 }  // namespace v8 | 143 }  // namespace v8 | 
| 144 | 144 | 
| 145 #endif  // V8_LOG_UTILS_H_ | 145 #endif  // V8_LOG_UTILS_H_ | 
| OLD | NEW | 
|---|