3.6. SMFileLogger

This class provides the function which outputs the StarIO.xcframework and StarIO_Extension.xcframework logs to files. It extends the SMLogger class.

Note

When inquiring using the logs recorded by this class, please also provide the date and time of the event that may have caused the problem.

  • Property

    Name

    Contents

    sharedInstance

    The singleton instance of the SMFileLogger class.

    maxLogSize

    Specifies the maximum log size to be kept.

    logDirectoryPath

    The directory path of log files to save.

The output log file is saved under the Documents/starlog directory of the application. You can access the saved file by using the file sharing function.

Ex. 1: When using iTunes file sharing

It is necessary to set items to Information Property List. The setting procedure is as follows.

  1. Click on the information property list file (default : “Info.plist”).

  2. Added The Application supports iTunes file sharing Key.

  3. Set the value to YES .

Ex. 2: Using opening documents in place

It is necessary to set items to Information Property List. The setting procedure is as follows.

  1. Click on the information property list file (default : “Info.plist”).

  2. Added The Supports opening documents in place Key.

  3. Set the value to YES .

3.6.1. sharedInstance

The singleton instance of the SMFileLogger class.

  • Declaration

    @property (class, nonatomic, readonly, nonnull) SMFileLogger *sharedInstance;
    
  • Value

    Contents

    Type

    The singleton instance of the SMFileLogger class.

    SMFileLogger

3.6.2. maxLogSize

Specifies the maximum log size to be kept.

  • Declaration

    @property(nonatomic) NSUInteger maxLogSize;
    
  • Value

    Contents

    Type

    Maximum log size to be kept (in MB)
    Default value: 50 (MB)
    If 0 is specified, no limit on log size is set.

    NSUInteger

3.6.3. logDirectoryPath

The directory path of log files to save.

  • Declaration

    @property (nonatomic, readonly) NSString *logDirectoryPath;
    
  • Value

    Contents

    Type

    The directory path of log files to save “Documents/starlog” is set.

    String

3.6.4. Sample of log output using the SMFileLogger class

// Get SMFileLogger class singleton instance.
SMFileLogger *logger = SMFileLogger.sharedInstance;

// Set the log level.
logger.logLevel = SMLogLevelDefault;

// Set the maximum log size to be kept (optional).
logger.maxLogSize = 10;

// Start log output.
[logger start];

// Output the desired string (optional).
[logger logString:@"(Log message)"];

// Stop log output.
[logger stop];