Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("rttlib")
- -- Set this to true to write the property files the first time.
- write_props=false
- tc = rtt.getTC()
- depl = tc:getPeer("deployer")
- -- Create components. Enable BUILD_LOGGING and BUILD_TESTS for this to
- -- work.
- depl:loadComponent("TestComponent","OCL::logging::test::Component")
- depl:setActivity("TestComponent", 2.0, 0, 0)
- depl:loadComponent("AppenderA", "OCL::logging::FileAppender")
- depl:setActivity("AppenderA", 0.5, 0, 0)
- depl:loadComponent("LoggingService", "OCL::logging::LoggingService")
- depl:setActivity("LoggingService", 0.5, 0, 0)
- test = depl:getPeer("TestComponent")
- aa = depl:getPeer("AppenderA")
- ls = depl:getPeer("LoggingService")
- depl:addPeer("AppenderA","LoggingService")
- -- Load marshalling service to read/write components
- depl:loadService("LoggingService","marshalling")
- depl:loadService("AppenderA","marshalling")
- if write_props then
- ls:provides("marshalling"):writeProperties("logging_properties.cpf")
- aa:provides("marshalling"):writeProperties("appender_properties.cpf")
- print("Wrote property files. Edit them and set write_props=false")
- os.exit(0)
- else
- ls:provides("marshalling"):loadProperties("logging_properties.cpf")
- aa:provides("marshalling"):loadProperties("appender_properties.cpf")
- end
- ls:configure()
- ls:start()
- ls:logCategories()
- test:configure()
- aa:configure()
- test:start()
- aa:start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement