
A guide on recommended safety/security practices when using the C++ SDK, and how developers can implement their own security measures.
Logging allows software developers to see the list of actions that underwent during the execution of their application. This tutorial tackles how to enable logging, when to use logging, the information logged, and how to retrieve the produced logs.
By default, logging is disabled. Logging can be enabled, before the product/license is configured within the application.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
std::string appName = "NAME"; //input name of application
std::string appVersion = "VERSION"; //input version of application
ExtendedOptions options;
//Setting the parameter to true enables logging, false disables. If we didn't add this line, it would be
//disabled by default.
options.enableLogging( true );
auto configuration = Configuration::Create(
EncryptStr( "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" ), // your LicenseSpring API key (UUID)
EncryptStr( "XXXXXXXXX-XXXXX-XXXXXXXXXXXXX_XXXXXX_XXXXXX" ), // your LicenseSpring Shared key
EncryptStr( "XXXXXX" ), // product code that you specified in LicenseSpring for your application
appName, appVersion, options );
auto licenseManager = LicenseManager::create( pConfiguration );
You can also check whether logging is enabled within your application.
1
configuration->isLoggingEnabled();
Logging is a helpful tool for software developers to reflect on the functionality of their applications. It also assists developers with capturing and fixing unexpected bugs that otherwise would have gone unnoticed. Beyond testing and debugging, logging can be an efficient way to learn the inner workings of the SDK.
Any request/response sent/received from the LicenseSpring servers. This includes, but is not limited to:
Basic hardware information such as:
Beyond that, logging will also capture:
All these will show up in the logs, as well as on what thread, and at the exact date and time they occurred.
Log files are kept in the same location as all other LicenseSpring data, such as your local license file. You can find out where this location is on your device, from your application using:
1
std::wstring path = licenseManager->licenseFilePath();
Or you can set the location of where you want the logs file as well as all other LicenseSpring data to be stored on your device with:
1
licenseManager->setDataLocation(L"new/path/to/LicenseSpring/data");
You should now be able to enable/disable logging within your application, know what is on your LicenseSpring logs, and find the location of the logs on your device. These will be very useful when debugging and trying to find errors within your code, however, they should be turned off in your release build, so that end-users do not have access to the logs.
Deactivating on most SDKs will delete all LicenseSpring related data. Luckily, most SDKs also offer a way to deactivate a license without deleting the license. To see more information on deactivation, see our Getting Started Tutorial.
It depends on your OS and what language you are using, but generally:
Default SDK data location on Windows is: {SystemDrive}:/Users/{UserName}/AppData/Local/LicenseSpring/{ProductCode}
Default SDK data location on Linux is: HOME/.LicenseSpring/LicenseSpring/{ProductCode}
Default SDK data location on MAC is: ~/Library/Application Support/LicenseSpring/{ProductCode}