| 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 <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 p += ::base::snprintf(p, limit - p, | 48 p += ::base::snprintf(p, limit - p, |
| 49 "%04d/%02d/%02d-%02d:%02d:%02d.%03d %" PRIu64 " ", | 49 "%04d/%02d/%02d-%02d:%02d:%02d.%03d %" PRIu64 " ", |
| 50 t.year, | 50 t.year, |
| 51 t.month, | 51 t.month, |
| 52 t.day_of_month, | 52 t.day_of_month, |
| 53 t.hour, | 53 t.hour, |
| 54 t.minute, | 54 t.minute, |
| 55 t.second, | 55 t.second, |
| 56 t.millisecond, | 56 t.millisecond, |
| 57 static_cast<long long unsigned int>(thread_id)); | 57 static_cast<uint64>(thread_id)); |
| 58 | 58 |
| 59 // Print the message | 59 // Print the message |
| 60 if (p < limit) { | 60 if (p < limit) { |
| 61 va_list backup_ap; | 61 va_list backup_ap; |
| 62 GG_VA_COPY(backup_ap, ap); | 62 GG_VA_COPY(backup_ap, ap); |
| 63 p += vsnprintf(p, limit - p, format, backup_ap); | 63 p += vsnprintf(p, limit - p, format, backup_ap); |
| 64 va_end(backup_ap); | 64 va_end(backup_ap); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Truncate to available space if necessary | 67 // Truncate to available space if necessary |
| (...skipping 20 matching lines...) Expand all Loading... |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 FILE* file_; | 92 FILE* file_; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace leveldb | 95 } // namespace leveldb |
| 96 | 96 |
| 97 #endif // THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ | 97 #endif // THIRD_PARTY_LEVELDATABASE_CHROMIUM_LOGGER_H_ |
| OLD | NEW |