Skip to content

Commit e721f9a

Browse files
unity-cli@v1.6.5
- renamed `licensing-logs` command to `licensing-client-logs` - added `licensing-audit-logs` - added `hub-logs`
1 parent e010489 commit e721f9a

5 files changed

Lines changed: 83 additions & 10 deletions

File tree

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ A powerful command line utility for the Unity Game Engine. Automate Unity projec
1515
- [Activate License](#activate-license)
1616
- [Return License](#return-license)
1717
- [License Context](#license-context)
18-
- [Licensing Logs](#licensing-logs)
18+
- [Licensing Client Logs](#licensing-client-logs)
19+
- [Licensing Audit Logs](#licensing-audit-logs)
1920
- [Unity Hub](#unity-hub)
2021
- [Hub Version](#hub-version)
2122
- [Hub Path](#hub-path)
23+
- [Hub Logs](#hub-logs)
2224
- [Unity Hub Install](#unity-hub-install)
2325
- [Run Unity Hub Commands](#run-unity-hub-commands)
2426
- [Setup Unity Editor](#setup-unity-editor)
@@ -121,12 +123,20 @@ unity-cli return-license --license personal
121123
unity-cli license-context
122124
```
123125

124-
##### Licensing Logs
126+
##### Licensing Client Logs
125127

126-
`licensing-logs`: Prints the path to the Unity Licensing Client log files.
128+
`licensing-client-logs`: Prints the path to the Unity Licensing Client log file.
127129

128130
```bash
129-
unity-cli licensing-logs
131+
unity-cli licensing-client-logs
132+
```
133+
134+
##### Licensing Audit Logs
135+
136+
`licensing-audit-logs`: Prints the path to the Unity Licensing Client audit log.
137+
138+
```bash
139+
unity-cli licensing-audit-logs
130140
```
131141

132142
#### Unity Hub
@@ -147,6 +157,14 @@ unity-cli hub-version
147157
unity-cli hub-path
148158
```
149159

160+
##### Hub Logs
161+
162+
`hub-logs`: Prints the path to the Unity Hub log file.
163+
164+
```bash
165+
unity-cli hub-logs
166+
```
167+
150168
##### Unity Hub Install
151169

152170
`hub-install [options]`: Install or update the Unity Hub

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rage-against-the-pixel/unity-cli",
3-
"version": "1.6.4",
3+
"version": "1.6.5",
44
"description": "A command line utility for the Unity Game Engine.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",

src/cli.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,17 @@ program.command('license-context')
148148
process.exit(0);
149149
});
150150

151-
program.command('licensing-logs')
152-
.description('Prints the path to the Unity Licensing Client log files.')
151+
program.command('licensing-client-logs')
152+
.description('Prints the path to the Unity Licensing Client log file.')
153153
.action(async () => {
154-
const client = new LicensingClient();
155-
process.stdout.write(`${client.logPath()}\n`);
154+
process.stdout.write(`${LicensingClient.ClientLogPath()}\n`);
155+
process.exit(0);
156+
});
157+
158+
program.command('licensing-audit-logs')
159+
.description('Prints the Unity Licensing Client audit log.')
160+
.action(async () => {
161+
process.stdout.write(`${LicensingClient.ClientAuditLogPath()}\n`);
156162
process.exit(0);
157163
});
158164

@@ -189,6 +195,13 @@ program.command('hub-path')
189195
process.exit(0);
190196
});
191197

198+
program.command('hub-logs')
199+
.description('Prints the path to the Unity Hub log file.')
200+
.action(async () => {
201+
process.stdout.write(`${UnityHub.LogPath()}\n`);
202+
process.exit(0);
203+
});
204+
192205
program.command('hub-install')
193206
.description('Install the Unity Hub.')
194207
.option('--verbose', 'Enable verbose logging.')

src/license-client.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class LicensingClient {
124124
* @see https://docs.unity.com/en-us/licensing-server/troubleshooting-client#logs
125125
* @returns The path to the log file.
126126
*/
127-
public logPath(): string {
127+
public static ClientLogPath(): string {
128128
switch (process.platform) {
129129
case 'win32':
130130
// $env:LOCALAPPDATA\Unity\Unity.Licensing.Client.log
@@ -140,6 +140,27 @@ export class LicensingClient {
140140
}
141141
}
142142

143+
/**
144+
* Gets the path to the Unity Licensing Client audit log file.
145+
* @see https://docs.unity.com/en-us/licensing-server/troubleshooting-client#logs
146+
* @returns The path to the audit log file.
147+
*/
148+
public static ClientAuditLogPath(): string {
149+
switch (process.platform) {
150+
case 'win32':
151+
// $env:LOCALAPPDATA\Unity\Unity.Entitlements.Audit.log
152+
return path.join(process.env.LOCALAPPDATA || '', 'Unity', 'Unity.Entitlements.Audit.log');
153+
case 'darwin':
154+
// ~/Library/Logs/Unity/Unity.Entitlements.Audit.log
155+
return path.join(os.homedir(), 'Library', 'Logs', 'Unity', 'Unity.Entitlements.Audit.log');
156+
case 'linux':
157+
// ~/.config/unity3d/Unity/Unity.Entitlements.Audit.log
158+
return path.join(os.homedir(), '.config', 'unity3d', 'Unity', 'Unity.Entitlements.Audit.log');
159+
default:
160+
throw new Error(`Unsupported platform: ${process.platform}`);
161+
}
162+
}
163+
143164
/**
144165
* Displays the context information of the licensing client to the console.
145166
* @see https://docs.unity.com/en-us/licensing-server/troubleshooting-client#exit-codes

src/unity-hub.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,4 +1258,25 @@ done
12581258

12591259
return moduleMap;
12601260
}
1261+
1262+
/**
1263+
* Returns the path to the Unity Hub log file.
1264+
* @see https://docs.unity.com/en-us/licensing-server/troubleshooting-client#logs
1265+
* @returns The Unity Hub log file path.
1266+
*/
1267+
public static LogPath(): string {
1268+
switch (process.platform) {
1269+
case 'win32':
1270+
// %APPDATA%\UnityHub\logs\info-log.json
1271+
return path.join(process.env.APPDATA || '', 'UnityHub', 'logs', 'info-log.json');
1272+
case 'darwin':
1273+
// ~/Library/Application Support/UnityHub/logs/info-log.json
1274+
return path.join(os.homedir(), 'Library', 'Application Support', 'UnityHub', 'logs', 'info-log.json');
1275+
case 'linux':
1276+
// ~/.config/UnityHub/logs/info-log.json
1277+
return path.join(os.homedir(), '.config', 'UnityHub', 'logs', 'info-log.json');
1278+
default:
1279+
throw new Error(`Unsupported platform: ${process.platform}`);
1280+
}
1281+
}
12611282
}

0 commit comments

Comments
 (0)