|
Line
Link Here
|
| 0 |
-- /c10/util/Logging.cpp |
0 |
++ /c10/util/Logging.cpp |
|
Lines 192-214
Link Here
|
| 192 |
google::GLOG_WARNING, |
192 |
google::GLOG_WARNING, |
| 193 |
"The minimum log level that caffe2 will output."); |
193 |
"The minimum log level that caffe2 will output."); |
| 194 |
|
194 |
|
| 195 |
// Google glog's api does not have an external function that allows one to check |
|
|
| 196 |
// if glog is initialized or not. It does have an internal function - so we are |
| 197 |
// declaring it here. This is a hack but has been used by a bunch of others too |
| 198 |
// (e.g. Torch). |
| 199 |
namespace google { |
| 200 |
namespace glog_internal_namespace_ { |
| 201 |
bool IsGoogleLoggingInitialized(); |
| 202 |
} // namespace glog_internal_namespace_ |
| 203 |
} // namespace google |
| 204 |
|
| 205 |
namespace c10 { |
195 |
namespace c10 { |
| 206 |
namespace { |
196 |
namespace { |
| 207 |
|
197 |
|
| 208 |
void initGoogleLogging(char const* name) { |
198 |
void initGoogleLogging(char const* name) { |
| 209 |
#if !defined(_MSC_VER) |
199 |
#if !defined(_MSC_VER) |
| 210 |
// This trick can only be used on UNIX platforms |
200 |
// This trick can only be used on UNIX platforms |
| 211 |
if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized()) |
201 |
if (!::google::IsGoogleLoggingInitialized()) |
| 212 |
#endif |
202 |
#endif |
| 213 |
{ |
203 |
{ |
| 214 |
::google::InitGoogleLogging(name); |
204 |
::google::InitGoogleLogging(name); |