Skip to content

Commit

Permalink
add compile info
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan committed Jan 5, 2015
1 parent a9862cc commit 3e1fa60
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/sofa/pbrpc/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

namespace sofa {
namespace pbrpc {

const char* compile_info()
{
return __DATE__ " " __TIME__ " by gcc "
SOFA_PBRPC_STR(__GNUC__) "." SOFA_PBRPC_STR(__GNUC_MINOR__)
"." SOFA_PBRPC_STR(__GNUC_PATCHLEVEL__);
}

namespace internal {

static LogLevel s_log_level = ::sofa::pbrpc::LOG_LEVEL_ERROR;
Expand Down
5 changes: 5 additions & 0 deletions src/sofa/pbrpc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace pbrpc {

#define SOFA_PBRPC_VERSION "1.0.1"

const char* compile_info();

/////////////// types /////////////
typedef ::google::protobuf::uint uint;

Expand All @@ -39,6 +41,9 @@ static const uint32 kuint32max = ::google::protobuf::kuint32max;
static const uint64 kuint64max = ::google::protobuf::kuint64max;

/////////////// util macros /////////////
#define SOFA_PBRPC_STR_I(var) #var
#define SOFA_PBRPC_STR(var) SOFA_PBRPC_STR_I(var)

#define SOFA_PBRPC_PP_CAT(a, b) SOFA_PBRPC_PP_CAT_I(a, b)
#define SOFA_PBRPC_PP_CAT_I(a, b) a ## b

Expand Down
3 changes: 2 additions & 1 deletion src/sofa/pbrpc/http_rpc_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ void HTTPRpcRequest::ServerBrief(
<< "<b>IP:</b> " << ip << "<br>"
<< "<b>Port:</b> " << port << "<br>"
<< "<b>Started:</b> " << ptime_to_string(service_pool->RpcServer()->GetStartTime()) << "<br>"
<< "<b>Version:</b> " << SOFA_PBRPC_VERSION << "<br>";
<< "<b>Version:</b> " << SOFA_PBRPC_VERSION << "<br>"
<< "<b>Compiled:</b> " << compile_info() << "<br>";
}

void HTTPRpcRequest::ServerOptions(
Expand Down

0 comments on commit 3e1fa60

Please sign in to comment.