| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ | 5 #ifndef THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ |
| 6 #define THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ | 6 #define THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bufsize = 30000; | 37 bufsize = 30000; |
| 38 base = new char[bufsize]; | 38 base = new char[bufsize]; |
| 39 } | 39 } |
| 40 char* p = base; | 40 char* p = base; |
| 41 char* limit = base + bufsize; | 41 char* limit = base + bufsize; |
| 42 | 42 |
| 43 ::base::Time::Exploded t; | 43 ::base::Time::Exploded t; |
| 44 ::base::Time::Now().LocalExplode(&t); | 44 ::base::Time::Now().LocalExplode(&t); |
| 45 | 45 |
| 46 p += ::base::snprintf(p, limit - p, | 46 p += ::base::snprintf(p, limit - p, |
| 47 "%04d/%02d/%02d-%02d:%02d:%02d.%03d %"PRIu64" ", | 47 "%04d/%02d/%02d-%02d:%02d:%02d.%03d %" PRIu64 " ", |
| 48 t.year, | 48 t.year, |
| 49 t.month, | 49 t.month, |
| 50 t.day_of_month, | 50 t.day_of_month, |
| 51 t.hour, | 51 t.hour, |
| 52 t.minute, | 52 t.minute, |
| 53 t.second, | 53 t.second, |
| 54 t.millisecond, | 54 t.millisecond, |
| 55 thread_id); | 55 thread_id); |
| 56 | 56 |
| 57 // Print the message | 57 // Print the message |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 break; | 85 break; |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 private: | 88 private: |
| 89 FILE* file_; | 89 FILE* file_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace leveldb | 92 } // namespace leveldb |
| 93 | 93 |
| 94 #endif // THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ | 94 #endif // THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ |
| OLD | NEW |