Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 0d8f572

Browse files
committed
Add better logging for Currency API
Slight tweak to readme.
1 parent 6a2b5ac commit 0d8f572

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ Installation & Usage
1717
4. Unzip the files into the desired folder.
1818
5. Open config.json in a text editor and add in your details - see later in readme for details
1919
6. Run the program: Streamlabs Rcon Integration.exe
20-
7. Select the desired profile from the dropdown and click Start.
21-
8. The integration is now running between the Streamlabs account and the game using the selected profile.
20+
7. Select the desired profile from the dropdown. Suggested are the `Print All` and `Print Most Fancy`.
21+
8. Click the Start button to connect the integration between Streamlabs and Factorio.
22+
9. The integration is now running between the Streamlabs account and the game using the selected profile. Test event sfrom streamlabs or from within the integration tool will now trigger activity within Factorio.
2223

2324
Should a critical error occur the program may fail to load or close. Details can be found in the most recent log file within the Logs folder.
2425

@@ -175,7 +176,7 @@ The program has a `config.json` that stores its global configuration. The settin
175176

176177
- Logging DaysLogsToKeep - How many days back of logs the program will keep. -1 keeps logs indefinitely.
177178
- Logging DebugLogging - If enhanced Debug logs are generated. true/false
178-
- Currency ApiLayerAccessKey - The Currency API key generated when wigning up to that free website.
179+
- Currency ApiLayerAccessKey - The Currency API key generated when signing up to the free currency API website.
179180
- Streamlabs SocketApiToken - Your streamlabs API key. This can be found on the streamlabs website under your account:
180181
1. login to streamlabs website.
181182
1. "Settings" on left hand menu.

Source/Currency.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ def __init__(self, state):
1414
def GetRates(self):
1515
if len(self.rates) > 0:
1616
return True
17+
self.logging.DebugLog("Checking for a currency cache file")
1718
if Os.path.isfile(self.cacheFileName):
1819
self.logging.DebugLog(
19-
"Trying to get currancy rates from cache file")
20+
"Currency rates cache file exists, so reviewing it")
2021
with open(self.cacheFileName, "r", encoding='utf-8') as file:
2122
data = Json.load(file)
2223
file.closed
@@ -31,6 +32,11 @@ def GetRates(self):
3132
self.logging.DebugLog(
3233
"Got currency rates from cache file")
3334
return True
35+
else:
36+
self.logging.DebugLog(
37+
"Currency rates cache file too old to use")
38+
else:
39+
self.logging.DebugLog("No currency rates cache file found")
3440

3541
self._SourceRateData()
3642
if len(self.rates) > 0:
@@ -51,6 +57,7 @@ def _SourceRateData(self):
5157
if not response["success"]:
5258
self.state.RecordActivity(
5359
self.state.translations.GetTranslation("Currency WebsiteDownloadFailed"))
60+
self.logging.Log(request.text)
5461
return False
5562
with open(self.cacheFileName, "w", encoding='utf-8') as file:
5663
file.write(Json.dumps(response))

Source/Streamlabs Rcon Integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class State():
1818
def __init__(self):
19-
self.version = "0.1.2"
19+
self.version = "0.1.3"
2020
self.config = Config(self)
2121
self.logging = Logging(self)
2222
self.config.LogMissingSettings()

Source/Translations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def LoadLocalisedTexts(self, language):
2222
"Status OBSConnecting": "OBS Connecting",
2323
"Status Running": "Running",
2424
"Status Stopped": "Stopped",
25-
"Currency WebsiteDownloadFailed": "ERROR: Can't get currency conversion data from website",
25+
"Currency WebsiteDownloadFailed": "ERROR: Can't get currency conversion data from website. See log for details.",
2626
"StreamlabsEvent ErrorProcessingEvent": "ERROR: event data not as expected: ",
2727
"StreamlabsEvent BadEventPayloadCount": "ERROR: wrong number of payloads in event: ",
2828
"StreamlabsEvent MissingEventPayloadCount": "ERROR: no payload in event",

0 commit comments

Comments
 (0)