logDataRecord
void log.logDataRecord ( DataRecord record )
void log.logDataRecord ( DataRecord record, int logLevel )
void log.logDataRecordDebug ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordInfo ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordWarn ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordError ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecord ( DataRecord record, int logLevel )
void log.logDataRecordDebug ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordInfo ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordWarn ( DataRecord record ) (professional and enterprise editions only)
void log.logDataRecordError ( DataRecord record ) (professional and enterprise editions only)
Description
Logs all the values in a Data Record to the log, with one line per value. If a value in the record is a List, Set, Map, Data Set, Scrapeable File, or Exception, it will have detailed output as well.
Parameters
- record The Data Record to output to the log
- logLevel (optional) The level to log the data record at, as an int
Values are 1-Debug, 2-Info, 3-Warn, 4-Error, or can be obtained from com.screenscraper.common.Notifiable.LEVEL_(DEBUG/INFO/WARN/ERROR)
When omitted, the log level used is the session logging level.
Return Values
This method returns nothing
Change Log
Version | Description |
---|---|
5.5.26a | Available in all editions. |
5.5.43a | Moved from session to log class. |
Examples
Log a Data Record
// Log a scraped data record before saving it to a database
log.logDataRecord(dataRecord);
log.logDataRecord(dataRecord);
The output from the above call might look something like this:
DataRecord --- A_FLOAT : 3.14159 --- A_LIST : List ------ Element 0 : Value 1 ------ Element 1 : Value 2 ------ Element 2 : Value 3 ------ Element 3 : Set --------- Element : A value --------- Element : More value --------- Element : Other stuff --- A_MAP : Map ------ KEY_1 : 1 ------ KEY_2 : 2 ------ KEY_3 : 3 --- A_SET : Set Logged above as "------ Element 3 : " --- A_STRING : Screen-Scraper --- AN_INT : 5
mikes on 10/27/2011 at 12:27 pm
- Printer-friendly version
- Login or register to post comments