You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by GitBox <gi...@apache.org> on 2019/04/23 04:02:06 UTC

[GitHub] [kudu] adembo commented on issue #19: logging: We should initialized logging BEFORE InstallLoggingCallback,…

adembo commented on issue #19: logging: We should initialized logging BEFORE InstallLoggingCallback,…
URL: https://github.com/apache/kudu/pull/19#issuecomment-485635255
 
 
   This commit shouldn't be necessary; see this code in client.cc:
   ```
   // We need to reroute all logging to stderr when the client library is
   // loaded. GoogleOnceInit() can do that, but there are multiple entry
   // points into the client code, and it'd need to be called in each one.
   // So instead, let's use a constructor function.
   //
   // This is restricted to the exported client builds only. In case of linking
   // with non-exported kudu client library, logging must be initialized
   // from the main() function of the corresponding binary: usually, that's done
   // by calling InitGoogleLoggingSafe(argv[0]).
   __attribute__((constructor))
   static void InitializeBasicLogging() {
     InitGoogleLoggingSafeBasic(kProgName);
   
     SetVerboseLevelFromEnvVar();
   }
   ```
   
   That gets run when libkudu_client.so is loaded at runtime, which is usually one of the first things done by an executable that dynamically links against libkudu_client.so, certainly before main() is run.
   
   What's the complete stack trace on error? Are you building example.cc in some non-standard way?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services