@ -78,7 +78,7 @@ size_t FormatBoundedFields(absl::LogSeverity severity, absl::Time timestamp,
absl : : LogSeverityName ( severity ) [ 0 ] , static_cast < int > ( tv . tv_sec ) ,
absl : : LogSeverityName ( severity ) [ 0 ] , static_cast < int > ( tv . tv_sec ) ,
static_cast < int > ( tv . tv_usec ) , static_cast < int > ( tid ) ) ;
static_cast < int > ( tv . tv_usec ) , static_cast < int > ( tid ) ) ;
if ( snprintf_result > = 0 ) {
if ( snprintf_result > = 0 ) {
buf . remove_prefix ( snprintf_result ) ;
buf . remove_prefix ( static_cast < size_t > ( snprintf_result ) ) ;
return static_cast < size_t > ( snprintf_result ) ;
return static_cast < size_t > ( snprintf_result ) ;
}
}
return 0 ;
return 0 ;
@ -87,26 +87,27 @@ size_t FormatBoundedFields(absl::LogSeverity severity, absl::Time timestamp,
char * p = buf . data ( ) ;
char * p = buf . data ( ) ;
* p + + = absl : : LogSeverityName ( severity ) [ 0 ] ;
* p + + = absl : : LogSeverityName ( severity ) [ 0 ] ;
const absl : : TimeZone : : CivilInfo ci = tz - > At ( timestamp ) ;
const absl : : TimeZone : : CivilInfo ci = tz - > At ( timestamp ) ;
absl : : numbers_internal : : PutTwoDigits ( ci . cs . month ( ) , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( ci . cs . month ( ) ) , p ) ;
p + = 2 ;
p + = 2 ;
absl : : numbers_internal : : PutTwoDigits ( ci . cs . day ( ) , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( ci . cs . day ( ) ) , p ) ;
p + = 2 ;
p + = 2 ;
* p + + = ' ' ;
* p + + = ' ' ;
absl : : numbers_internal : : PutTwoDigits ( ci . cs . hour ( ) , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( ci . cs . hour ( ) ) , p ) ;
p + = 2 ;
p + = 2 ;
* p + + = ' : ' ;
* p + + = ' : ' ;
absl : : numbers_internal : : PutTwoDigits ( ci . cs . minute ( ) , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( ci . cs . minute ( ) ) , p ) ;
p + = 2 ;
p + = 2 ;
* p + + = ' : ' ;
* p + + = ' : ' ;
absl : : numbers_internal : : PutTwoDigits ( ci . cs . second ( ) , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( ci . cs . second ( ) ) , p ) ;
p + = 2 ;
p + = 2 ;
* p + + = ' . ' ;
* p + + = ' . ' ;
const int64_t usecs = absl : : ToInt64Microseconds ( ci . subsecond ) ;
const int64_t usecs = absl : : ToInt64Microseconds ( ci . subsecond ) ;
absl : : numbers_internal : : PutTwoDigits ( usecs / 10000 , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( usecs / 10000 ) , p ) ;
p + = 2 ;
p + = 2 ;
absl : : numbers_internal : : PutTwoDigits ( usecs / 100 % 100 , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( usecs / 100 % 100 ) ,
p ) ;
p + = 2 ;
p + = 2 ;
absl : : numbers_internal : : PutTwoDigits ( usecs % 100 , p ) ;
absl : : numbers_internal : : PutTwoDigits ( static_cast < size_t > ( usecs % 100 ) , p ) ;
p + = 2 ;
p + = 2 ;
* p + + = ' ' ;
* p + + = ' ' ;
constexpr bool unsigned_tid_t = ! std : : is_signed < log_internal : : Tid > : : value ;
constexpr bool unsigned_tid_t = ! std : : is_signed < log_internal : : Tid > : : value ;
@ -118,7 +119,7 @@ size_t FormatBoundedFields(absl::LogSeverity severity, absl::Time timestamp,
if ( ( unsigned_tid_t | | tid > - 100000 ) & & tid < 1000000 ) * p + + = ' ' ;
if ( ( unsigned_tid_t | | tid > - 100000 ) & & tid < 1000000 ) * p + + = ' ' ;
p = absl : : numbers_internal : : FastIntToBuffer ( tid , p ) ;
p = absl : : numbers_internal : : FastIntToBuffer ( tid , p ) ;
* p + + = ' ' ;
* p + + = ' ' ;
const size_t bytes_formatted = p - buf . data ( ) ;
const size_t bytes_formatted = static_cast < size_t > ( p - buf . data ( ) ) ;
buf . remove_prefix ( bytes_formatted ) ;
buf . remove_prefix ( bytes_formatted ) ;
return bytes_formatted ;
return bytes_formatted ;
}
}
@ -146,7 +147,7 @@ size_t FormatLineNumber(int line, absl::Span<char>& buf) {
p = absl : : numbers_internal : : FastIntToBuffer ( line , p ) ;
p = absl : : numbers_internal : : FastIntToBuffer ( line , p ) ;
* p + + = ' ] ' ;
* p + + = ' ] ' ;
* p + + = ' ' ;
* p + + = ' ' ;
const size_t bytes_formatted = p - buf . data ( ) ;
const size_t bytes_formatted = static_cast < size_t > ( p - buf . data ( ) ) ;
buf . remove_prefix ( bytes_formatted ) ;
buf . remove_prefix ( bytes_formatted ) ;
return bytes_formatted ;
return bytes_formatted ;
}
}