summarylogtreecommitdiffstats
path: root/87773.patch
blob: b598e08df68247512566b748d9a5910e08a9a70e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 94465d6287e8f54c99f4b0b891a6c618bb80d7ce Mon Sep 17 00:00:00 2001
From: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>
Date: Wed, 26 Oct 2022 07:32:59 +0200
Subject: [PATCH] Support only GLog >=0.6.0

Fixes https://github.com/pytorch/pytorch/issues/58054
---
 c10/util/Logging.cpp | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/c10/util/Logging.cpp b/c10/util/Logging.cpp
index fe74e49548646..d8fce12ce4840 100644
--- a/c10/util/Logging.cpp
+++ b/c10/util/Logging.cpp
@@ -192,23 +192,13 @@ C10_DEFINE_int(
     google::GLOG_WARNING,
     "The minimum log level that caffe2 will output.");
 
-// Google glog's api does not have an external function that allows one to check
-// if glog is initialized or not. It does have an internal function - so we are
-// declaring it here. This is a hack but has been used by a bunch of others too
-// (e.g. Torch).
-namespace google {
-namespace glog_internal_namespace_ {
-bool IsGoogleLoggingInitialized();
-} // namespace glog_internal_namespace_
-} // namespace google
-
 namespace c10 {
 namespace {
 
 void initGoogleLogging(char const* name) {
 #if !defined(_MSC_VER)
   // This trick can only be used on UNIX platforms
-  if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized())
+  if (!::google::IsGoogleLoggingInitialized())
 #endif
   {
     ::google::InitGoogleLogging(name);