Comments (6)
I would have expected this to work:
let str = String.fromCString(getenv("XcodeColors")) // String?
It reports nil although the plugin is working
doing setenv("XcodeColors", "NO", 0)
does not disable it.
from xcodecolors.
let xcode_colors = getenv("XcodeColors")
if strcmp(xcode_colors, "YES") == 0 {
return true
}
return false
try this
from xcodecolors.
I'm not getting clear behavior on this either. In Swift, I would expect the code to check whether XcodeColors was installed to be something like this:
let canColor = NSProcessInfo().environment["XcodeColors"] == "YES"
But, that environment variable is always nil. However, if I go set it manually, it can read it fine.
setenv("XcodeColors", "YES", 0)
let canColor = NSProcessInfo().environment["XcodeColors"] == "YES"
The colors DO work, I'm just not able to see if the plugin is installed. Any tips?
from xcodecolors.
Nevermind, I understand now. I'm working on an iOS app. The environment variables won't work in iOS because those environment variables are defined on my Mac, not on my iDevice or my simulator. That's a bit of a bummer - I want a way for this to "just work" for the developers that have XcodeColors installed, and gracefully fall back to normal logging for developers that don't. Is there any way to have user-specific environment variables defined for the simulator?
from xcodecolors.
Combined with cocoalumberjack, old C style \o/
DDLog.addLogger(DDTTYLogger.sharedInstance()) // TTY = Xcode console
let xcode_colors = getenv("XcodeColors");
if xcode_colors != nil && strcmp(xcode_colors, "YES") == 0 {
DDTTYLogger.sharedInstance().colorsEnabled = true;
}
from xcodecolors.
Using this with Alcatraz getenv("XcodeColors") never works. I've implemented the check both with Swift and with Objective C— it is never enabled.
Tips?
from xcodecolors.
Related Issues (20)
- Swift's debugPrint is not colored HOT 1
- Add support for the standard ANSI escape codes HOT 2
- Save to ship .xcplugin file?
- XcodeColors not working on latest Xcode version (7.2) HOT 2
- Xcode 7.2 Issue HOT 14
- when print long long string,only part of string has color HOT 2
- ed "("
- Xcode 7.2.1? HOT 1
- When running xcodebuild from terminal other plugins' log statements are not properly escaped
- Xcode 7.3 exception HOT 2
- Not working in Xcode 7.3 HOT 3
- Test
- Not working on Xcode 7.3.1 HOT 1
- Xcode8 Editor Extension HOT 24
- Has no effect in Xcode 8 GM HOT 1
- Xcode 8 kills code colors HOT 11
- Is there any way to use colors in lldb? HOT 1
- Can't work Xcode9? HOT 5
- Xcode 10 seems to brake the plugin completely HOT 23
- xcode13 do not work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcodecolors.