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 public: | 23 public: |
24 // Performs process-wide initialization. | 24 // Performs process-wide initialization. |
25 void Initialize(const char* log_file_name); | 25 void Initialize(const char* log_file_name); |
26 | 26 |
27 // Disables logging, but preserves acquired resources. | 27 // Disables logging, but preserves acquired resources. |
28 void stop() { is_stopped_ = true; } | 28 void stop() { is_stopped_ = true; } |
29 | 29 |
30 static bool InitLogAtStart() { | 30 static bool InitLogAtStart() { |
31 return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc || | 31 return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc || |
32 FLAG_log_handles || FLAG_log_suspect || FLAG_log_regexp || | 32 FLAG_log_handles || FLAG_log_suspect || FLAG_log_regexp || |
33 FLAG_ll_prof || FLAG_perf_basic_prof || | 33 FLAG_ll_prof || FLAG_perf_basic_prof || FLAG_perf_prof || |
34 FLAG_log_internal_timer_events || FLAG_prof_cpp; | 34 FLAG_log_internal_timer_events || FLAG_prof_cpp; |
35 } | 35 } |
36 | 36 |
37 // Frees all resources acquired in Initialize and Open... functions. | 37 // Frees all resources acquired in Initialize and Open... functions. |
38 // When a temporary file is used for the log, returns its stream descriptor, | 38 // When a temporary file is used for the log, returns its stream descriptor, |
39 // leaving the file open. | 39 // leaving the file open. |
40 FILE* Close(); | 40 FILE* Close(); |
41 | 41 |
42 // Returns whether logging is enabled. | 42 // Returns whether logging is enabled. |
43 bool IsEnabled() { | 43 bool IsEnabled() { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Logger* logger_; | 135 Logger* logger_; |
136 | 136 |
137 friend class Logger; | 137 friend class Logger; |
138 }; | 138 }; |
139 | 139 |
140 | 140 |
141 } // namespace internal | 141 } // namespace internal |
142 } // namespace v8 | 142 } // namespace v8 |
143 | 143 |
144 #endif // V8_LOG_UTILS_H_ | 144 #endif // V8_LOG_UTILS_H_ |
OLD | NEW |