Project

job_log

0.0
No commit activity in last 3 years
No release in over 3 years
Logs the start and end of a job by subscribing to the SPS topic log.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.7.26, ~> 1.7
>= 0.3.6, ~> 0.3
 Project Readme

Introducing the job_log gem

Usage

require 'job_log'

jl = JobLog.new
jl.listen

The job_log gem subscribes to the following topics:

  • log/+/started/+
  • log/+/done/+
  • log/+/aborted/+

Entries are save into the the Dynarex file job_log.xml.

Testing

require 'spspub_log'

sps = SPSPubLog.new host: 'sps2', port: 59100
sps.info 'frt/started: Fetches the remaining bank balance. #bank #balance'

sleep 3

sps.info 'frt/done: bye'

Output

file: job_log.xml

<?xml version='1.0' encoding='UTF-8'?>
<jobs>
  <summary>
    <recordx_type>dynarex</recordx_type>
    <format_mask>[!title] [!desc] [!started] [!ended] [!status] [!tags]</format_mask>
    <schema>jobs/job(title, desc, started, ended, status, tags)</schema>
    <default_key>title</default_key>
  </summary>
  <records>
    <job id='1' created='2017-10-30 11:39:34 +0000' last_modified='2017-10-30 11:39:37 +0000'>
      <title>frt</title>
      <desc>Fetches the remaining bank balance.</desc>
      <started>2017-10-30 11:39:34 +0000</started>
      <ended>2017-10-30 11:39:37 +0000</ended>
      <status>success</status>
      <tags>bank balance</tags>
    </job>
  </records>
</jobs>

Resources

joblog job_log gem job log spspublog sps