Giter Site home page Giter Site logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
GLOG_ prefix should just work if you are not using gflags. Please make sure you 
don't 
have gflags installed and you are setting correct environment variable (note 
that 
GLOG should be capitalized, and logtostderr should not be capitalized). Some 
environment variables like GOOGLE_LOGTOSTDERR is defined by historical reason. 
I 
don't expect users of glog to use them.

Please post more details if you are still not able to use GLOG_ variables and 
I'll 
help to figure out why they aren't working as possible.

By the way, I guess I should make GLOG_* variables work even if gflags are 
installed...

Original comment by [email protected] on 23 Oct 2009 at 9:36

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
I think I had the problem that I installed gflags. Precisely, I told glog about
gflags. I guess that's why only GOOGLE_LOGTOSTDERR worked me. But I forgot to 
link
against the gflags library. That's why passing arguments didn't work. Having 
both
(environment and flags) to be working would be great.

Original comment by [email protected] on 26 Oct 2009 at 9:56

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Hi, I have a similar problem.. I have compiled glog version 0.3.0 and gflags was
installed at my machine (I have informed the CPPFLAGS and LDFLAGS to point to 
gflags
include and library dir respectively). The 'configure' script seems to find 
gflags,
but none of the --<flags> seems to work. GLOG_* flags didn't work either...

The application using glog must print the glog supported flags at --help 
command line
argument? Because it does not show any glog flags... My application is a test 
app
using google test, dont know if theres some issue using glog + gtest... 

Any hints? Thanks!

Original comment by [email protected] on 7 Jan 2010 at 9:52

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Yeah, you should see glog specific command line flags by --help like

  Flags from src/logging.cc:
    -alsologtoemail (log messages go to these email addresses in addition to
      logfiles) type: string default: ""
  ...

The glog specific flags should appear in the list of --help if you link glog 
(-lglog 
for your compiler if you're using linux). This should happen even if your 
source code 
doesn't use glog at all and you just need to link your program with glog. So, 
please 
make sure you are linking glog properly.

If this setting is fine, I have no idea so far... Please provide more 
information and 
I'll investigate as possible. Thanks.

Original comment by [email protected] on 12 Jan 2010 at 8:47

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
pablo, I think you forgot to initialize gflags in your program (jens probably 
did the
same). Easiest solution would be to just #include <gflags/gflags.h>, and insert
google::ParseCommandLineFlags(&argc, &argv, true); as the first line inside 
your main
function. Remember to link with -lgflags as well. I think this necessary step is
easily overlooked... perhaps there should be a small reminder in the glog
documentation page.

Original comment by [email protected] on 30 Jan 2010 at 3:45

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Yeah. You're right. I recently did it as you say. I just would expect that glog 
is
doing this for me since it has this dependency. But I think since the 
dependency is
optional glog can't do so. Right? Having the documentation updated would be 
helpful.
So basically one has two options either using flags, then you have to
1. include <gflags/gflags.h>
2. call google::ParseCommandLineFlags
3. and link against gflags
or just set things via GLOG_* environment variables. For this you need no 
gflags at
all. But I can't get it to work. I attach a very simple program. I run it
$ GLOG_logtostderr=1 ./glog
But it keeps writing files to /tmp instead of logging to stderr.

Original comment by [email protected] on 30 Jan 2010 at 1:32

Attachments:

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
I got an issue when compiling glog by running 'make' after running './configure'
Then I got an error: 

Undefined symbols for architecture x86_64:
  "testing::internal::StrStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)", referenced from:
      testing::internal::String testing::internal::StreamableToString<void const*>(void const* const&) in logging_unittest-logging_unittest.o
      testing::internal::String testing::internal::StreamableToString<int>(int const&) in logging_unittest-logging_unittest.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [logging_unittest] Error 1

I am using glog-0.3.3 on Mac OS X. 
SO how can i turn of testing while compiling glog?

In another context, i installed glog and gflags by using Macport, then i run a 
small program. It will generate a error : 
"ERROR: unknown command line flag 'logtostderr'"

I believe that's the problem with linking to gflags. So how can i fix it. 
Thanks 

Original comment by [email protected] on 8 May 2014 at 6:17

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
As for the link error in logging_unittest, I think you have gtest installed and 
it is conflicting with glog for some reason. The easiest solution would be 
simply uninstalling gtest or ignore this error by make -k5000 or something and 
just use libglog.

As for the latter issue, I think you can use GLOG_logtostderr ./your_program or 
you can do GLOG_logtostderr=true at the beginning of your main(). 

Original comment by [email protected] on 8 May 2014 at 1:42

from google-glog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.