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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Functions and data for performing output of log messages. | 38 // Functions and data for performing output of log messages. |
39 class Log { | 39 class Log { |
40 public: | 40 public: |
41 // Performs process-wide initialization. | 41 // Performs process-wide initialization. |
42 void Initialize(); | 42 void Initialize(); |
43 | 43 |
44 // Disables logging, but preserves acquired resources. | 44 // Disables logging, but preserves acquired resources. |
45 void stop() { is_stopped_ = true; } | 45 void stop() { is_stopped_ = true; } |
46 | 46 |
| 47 static bool InitLogAtStart() { |
| 48 return FLAG_log || FLAG_log_runtime || FLAG_log_api |
| 49 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect |
| 50 || FLAG_log_regexp || FLAG_ll_prof || FLAG_log_internal_timer_events; |
| 51 } |
| 52 |
47 // Frees all resources acquired in Initialize and Open... functions. | 53 // Frees all resources acquired in Initialize and Open... functions. |
48 // When a temporary file is used for the log, returns its stream descriptor, | 54 // When a temporary file is used for the log, returns its stream descriptor, |
49 // leaving the file open. | 55 // leaving the file open. |
50 FILE* Close(); | 56 FILE* Close(); |
51 | 57 |
52 // Returns whether logging is enabled. | 58 // Returns whether logging is enabled. |
53 bool IsEnabled() { | 59 bool IsEnabled() { |
54 return !is_stopped_ && output_handle_ != NULL; | 60 return !is_stopped_ && output_handle_ != NULL; |
55 } | 61 } |
56 | 62 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 148 |
143 private: | 149 private: |
144 Log* log_; | 150 Log* log_; |
145 ScopedLock sl; | 151 ScopedLock sl; |
146 int pos_; | 152 int pos_; |
147 }; | 153 }; |
148 | 154 |
149 } } // namespace v8::internal | 155 } } // namespace v8::internal |
150 | 156 |
151 #endif // V8_LOG_UTILS_H_ | 157 #endif // V8_LOG_UTILS_H_ |
OLD | NEW |