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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Returns whether logging is enabled. | 52 // Returns whether logging is enabled. |
53 bool IsEnabled() { | 53 bool IsEnabled() { |
54 return !is_stopped_ && output_handle_ != NULL; | 54 return !is_stopped_ && output_handle_ != NULL; |
55 } | 55 } |
56 | 56 |
57 // Size of buffer used for formatting log messages. | 57 // Size of buffer used for formatting log messages. |
58 static const int kMessageBufferSize = 2048; | 58 static const int kMessageBufferSize = 2048; |
59 | 59 |
60 // This mode is only used in tests, as temporary files are automatically | 60 // This mode is only used in tests, as temporary files are automatically |
61 // deleted on close and thus can't be accessed afterwards. | 61 // deleted on close and thus can't be accessed afterwards. |
62 static const char* kLogToTemporaryFile; | 62 static const char* const kLogToTemporaryFile; |
63 | 63 |
64 private: | 64 private: |
65 explicit Log(Logger* logger); | 65 explicit Log(Logger* logger); |
66 | 66 |
67 // Opens stdout for logging. | 67 // Opens stdout for logging. |
68 void OpenStdout(); | 68 void OpenStdout(); |
69 | 69 |
70 // Opens file for logging. | 70 // Opens file for logging. |
71 void OpenFile(const char* name); | 71 void OpenFile(const char* name); |
72 | 72 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 private: | 143 private: |
144 | 144 |
145 Log* log_; | 145 Log* log_; |
146 ScopedLock sl; | 146 ScopedLock sl; |
147 int pos_; | 147 int pos_; |
148 }; | 148 }; |
149 | 149 |
150 } } // namespace v8::internal | 150 } } // namespace v8::internal |
151 | 151 |
152 #endif // V8_LOG_UTILS_H_ | 152 #endif // V8_LOG_UTILS_H_ |
OLD | NEW |