Logging and Taps

Logging is configured using environmental variblase or command line option --robotraconteur-log-level= with the node setup classes, or using the RobotRaconteur.SetLogLevel() with the RobotRaconteur.LogLevel_* enum values.

Log output target can be configured using RobotRaconter.RobotRaconturNode.SetLogRecordHandler(). By default the output is sent to stderr. The RobotRaconteur.RobotRaconteurNode.FileLogRecordHandler can be used to save the log to a file.

Taps are used to record log records and message traffic. The “local tap” creates a local socket that a recording program can connect to record the traffic. This can be enabled using the --robotraconteur-local-tap-enable=true and --robotraconteur-local-tap-name= command line options with the node setup classes.

RRLogRecord Class

class RobotRaconteur.RRLogRecord

Robot Raconteur log record

Records information about a logging event

See ref logging for more information.

property Component

(int) The source component

property ComponentName

(str) The source component name

property ComponentObjectID

(str) The source component object ID

property Endpoint

(int) The source endpoint

property FiberID

(str) The source coroutine fiber

property Level

(int) The log level

property Member

(str) The source member

property Message

(str) Human readable log message

property Node

(RobotRaconteur.RobotRaconteurNode) The source node

property ServicePath

(str) The service path of the source object

property SourceFile

(str) The sourcecode filename

property SourceLine

(int) The line within the sourcecode file

property ThreadID

(str) The source thread

property Time

(datetime.datetime) Time of logging event

LogRecordHandler Class

class RobotRaconteur.LogRecordHandler

Base class of log record handler

By default, RobotRaconteurNode will print log records to stderr. Use RobotRaconteur.RobotRaconteurNode.SetLogRecordHandler() to specify a LogRecordHandler to accept log records instead of printing them to the terminal.

See ref logging for more information.

FileLogRecordHandler Class

class RobotRaconteur.FileLogRecordHandler

Log record handler that saves to a file

See ref logging for more information.

OpenFile(filename, append=True)

Open a file to store log records

Parameters:
  • filename (str) – The filename

  • append (bool) – If True, log messages are appended. If False, the file is truncated when opened

LogLevel Enum

RobotRaconteur.LogLevel_Trace = 0

trace log level

RobotRaconteur.LogLevel_Debug = 1

debug log level

RobotRaconteur.LogLevel_Info = 2

info log level

RobotRaconteur.LogLevel_Warning = 3

warning log level

RobotRaconteur.LogLevel_Error = 4

error log level

RobotRaconteur.LogLevel_Fatal = 5

fatal log level

RobotRaconteur.LogLevel_Disable = 1000

disabled log level

LogComponent Enum

RobotRaconteur.LogComponent_Default = 0

default component

RobotRaconteur.LogComponent_Node = 1

Robot Raconteur Node component

RobotRaconteur.LogComponent_Transport = 2

tranport component

RobotRaconteur.LogComponent_Message = 3

message or message serialization component

RobotRaconteur.LogComponent_Client = 4

client component

RobotRaconteur.LogComponent_Service = 5

service component

RobotRaconteur.LogComponent_Member = 6

member component

RobotRaconteur.LogComponent_Pack = 7

data message packing component

RobotRaconteur.LogComponent_Unpack = 8

data message unpacknig component

RobotRaconteur.LogComponent_ServiceDefinition = 9

service definition parser component

RobotRaconteur.LogComponent_Discovery = 10

node/service discovery component

RobotRaconteur.LogComponent_Subscription = 11

subscription component

RobotRaconteur.LogComponent_NodeSetup = 12

node setup component

RobotRaconteur.LogComponent_Utility = 13

utility component

RobotRaconteur.LogComponent_RobDefLib = 14

service definition standard library component (external)

RobotRaconteur.LogComponent_User = 15

user component (external)

RobotRaconteur.LogComponent_UserClient = 16

user client component (external)

RobotRaconteur.LogComponent_UserService = 17

user service component (external)

RobotRaconteur.LogComponent_ThirdParty = 18

third party library component (external)