Standards for logging text for pattern/flow/debug

52 views Asked by At

When using Origen for test content generation, is there a standard in practice for logging text? I see in other examples 'ss' and 'cc' as well as places where 'puts' is used.

What is the proper usage for comments that should go into Origen generated test patterns and flow elements, comments that should print during generation, and comments that should only print when debug is on?

1

There are 1 answers

0
Ginty On BEST ANSWER

Generally puts should never be used except for temporary debugging. The convention in Origen applications is to keep logging as light as possible, this in reaction to many tools in this space which are overly verbose in their logging such that it becomes mostly ignored by users.

So only log to the terminal when you think it is really important by doing this:

Origen.log.info "Something important to tell the user!"

Most of the time, if the information is just for debug purposes, then use:

Origen.log.debug "Some debug help, the value of X is: #{x}"

In that case, then the terminal output will be clean, but you will see the debug info being output when ever you run Origen with the -d switch -verbose switch.

You can read more about other logging options here: http://origen-sdk.org/origen//guides/misc/logger

Additionally, if you are using Origen to generate a pattern, then the cc and ss methods are available.

cc "A low level comment"

Will appear in a pattern like this:

// A low level comment

For the main steps in a pattern you can use ss:

ss "A high level comment"

which will look more emphasized, like this:

//####################################################################
//# A high level comment
//####################################################################

For multi-line step comments, you can use this API:

step_comment do
  cc "We are about to do this:"
  cc "  Blah: blah"
  cc "  Blah: blah"
end

Which would look like:

//####################################################################
//# We are about to do this:
//#   Blah: blah
//#   Blah: blah
//####################################################################

You can read more about how to document patterns here: http://origen-sdk.org/origen/guides/pattern/documenting/