@@ -125,7 +125,6 @@ - (id)initWithForegroundColor:(OSColor *)fgColor backgroundColor:(OSColor *)bgCo
125
125
126
126
@implementation DDTTYLogger
127
127
128
- static BOOL isaTTY;
129
128
static BOOL isaColorTTY;
130
129
static BOOL isaColor256TTY;
131
130
static BOOL isaXcodeColorTTY;
@@ -770,8 +769,6 @@ + (void)initialize
770
769
{
771
770
initialized = YES ;
772
771
773
- isaTTY = isatty (STDERR_FILENO);
774
-
775
772
char *term = getenv (" TERM" );
776
773
if (term)
777
774
{
@@ -822,42 +819,39 @@ - (id)init
822
819
823
820
if ((self = [super init ]))
824
821
{
825
- if (isaTTY)
826
- {
827
- calendar = [NSCalendar autoupdatingCurrentCalendar ];
828
-
829
- calendarUnitFlags = 0 ;
830
- calendarUnitFlags |= NSYearCalendarUnit ;
831
- calendarUnitFlags |= NSMonthCalendarUnit ;
832
- calendarUnitFlags |= NSDayCalendarUnit ;
833
- calendarUnitFlags |= NSHourCalendarUnit ;
834
- calendarUnitFlags |= NSMinuteCalendarUnit ;
835
- calendarUnitFlags |= NSSecondCalendarUnit ;
836
-
837
- // Initialze 'app' variable (char *)
838
-
839
- appName = [[NSProcessInfo processInfo ] processName ];
840
-
841
- appLen = [appName lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
842
- app = (char *)malloc (appLen + 1 );
843
-
844
- [appName getCString: app maxLength: (appLen+1 ) encoding: NSUTF8StringEncoding];
845
-
846
- // Initialize 'pid' variable (char *)
847
-
848
- processID = [NSString stringWithFormat: @" %i " , (int )getpid ()];
849
-
850
- pidLen = [processID lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
851
- pid = (char *)malloc (pidLen + 1 );
852
-
853
- [processID getCString: pid maxLength: (pidLen+1 ) encoding: NSUTF8StringEncoding];
854
-
855
- // Initialize color stuff
856
-
857
- colorsEnabled = NO ;
858
- colorProfilesArray = [[NSMutableArray alloc ] initWithCapacity: 8 ];
859
- colorProfilesDict = [[NSMutableDictionary alloc ] initWithCapacity: 8 ];
860
- }
822
+ calendar = [NSCalendar autoupdatingCurrentCalendar ];
823
+
824
+ calendarUnitFlags = 0 ;
825
+ calendarUnitFlags |= NSYearCalendarUnit ;
826
+ calendarUnitFlags |= NSMonthCalendarUnit ;
827
+ calendarUnitFlags |= NSDayCalendarUnit ;
828
+ calendarUnitFlags |= NSHourCalendarUnit ;
829
+ calendarUnitFlags |= NSMinuteCalendarUnit ;
830
+ calendarUnitFlags |= NSSecondCalendarUnit ;
831
+
832
+ // Initialze 'app' variable (char *)
833
+
834
+ appName = [[NSProcessInfo processInfo ] processName ];
835
+
836
+ appLen = [appName lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
837
+ app = (char *)malloc (appLen + 1 );
838
+
839
+ [appName getCString: app maxLength: (appLen+1 ) encoding: NSUTF8StringEncoding];
840
+
841
+ // Initialize 'pid' variable (char *)
842
+
843
+ processID = [NSString stringWithFormat: @" %i " , (int )getpid ()];
844
+
845
+ pidLen = [processID lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
846
+ pid = (char *)malloc (pidLen + 1 );
847
+
848
+ [processID getCString: pid maxLength: (pidLen+1 ) encoding: NSUTF8StringEncoding];
849
+
850
+ // Initialize color stuff
851
+
852
+ colorsEnabled = NO ;
853
+ colorProfilesArray = [[NSMutableArray alloc ] initWithCapacity: 8 ];
854
+ colorProfilesDict = [[NSMutableDictionary alloc ] initWithCapacity: 8 ];
861
855
}
862
856
return self;
863
857
}
@@ -1168,8 +1162,6 @@ - (void)clearAllColors
1168
1162
1169
1163
- (void )logMessage : (DDLogMessage *)logMessage
1170
1164
{
1171
- if (!isaTTY) return ;
1172
-
1173
1165
NSString *logMsg = logMessage->logMsg ;
1174
1166
BOOL isFormatted = NO ;
1175
1167
0 commit comments