Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

BWEnv: Log to /tmp/tc_data on non-Windows platforms #219

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jgehring
Copy link
Member

@jgehring jgehring commented Nov 6, 2017

This is a quick fix to ease debugging on non-Windows platforms.

@@ -40,12 +40,20 @@ void ConfigManager::loadDefault()
void ConfigManager::loadGeneralSection()
{
port = readInt_("general", "port", 0);
#ifdef _WIN32
log_path = readString_("general", "log_path", "C:/tc_data/torchcraft_log_cpp_port_");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe %SystemDrive% instead of C: (same below)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive my ignorance, but will Windows automatically expand this to e.g. C:/, or does this require some environment variable lookup?

Copy link
Contributor

@dgant dgant Nov 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty confident the replacement is handled at the OS level. For example, this works:
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure -- I can do ls ~ as well but that doesn't mean I can use it like that when opening a std::ifstream (right?) as there's no shell expansion happening. Anyway, will try it since information about this seems hard to find online.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants