NAME
Net::Stomp::MooseHelpers::TracerRole - role to dump Net::Stomp frames to disk
VERSION
version 3.0
DESCRIPTION
This role is not to be used directly, look at Net::Stomp::MooseHelpers::TraceStomp and Net::Stomp::MooseHelpers::TraceOnly.
This role provides attributes and methods to write to disk every outgoing and incoming STOMP frame.
The frames are written as they are "on the wire" (no encoding conversion happens), one file per frame. Each frame is written into a directory under "trace_basedir" with a name derived from the frame destination.
ATTRIBUTES
trace_basedir
The directory under which frames will be dumped. Accepts strings and Path::Class::Dir objects. If it's not specified and you enable "trace", every frame will generate a warning.
trace
Boolean attribute to enable or disable tracing / dumping of frames. If you enable tracing but don't set "trace_basedir", every frame will generate a warning.
trace_permissions
The permissions (as in "chmod" in perlfunc) to set the dumped files to. Accepts integers and strings with base-8 representation (see "Permissions" in Net::Stomp::MooseHelpers::Types and "OctalPermissions" in Net::Stomp::MooseHelpers::Types). The actual permissions applied will also depend on the umask.
trace_directory_permissions
The permissions (as in "chmod" in perlfunc) to set the directories for dumped files to. Accepts integers and strings with base-8 representation (see "Permissions" in Net::Stomp::MooseHelpers::Types and "OctalPermissions" in Net::Stomp::MooseHelpers::Types). The actual permissions applied will also depend on the umask.
trace_types
Arrayref of frame types to dump (strings, compared case-insensitively). Defaults to ['SEND','MESSAGE']
. If set to an empty array, all frame types will be dumped (this was the behaviour is previous versions).
METHODS
_dirname_from_destination
Generate a directory name from a frame destination. By default, replaces every sequence of non-word characters with '_'
.
_filename_from_frame
Returns a filehandle / filename pair for the file to write the frame into. Avoids duplicates by using Time::HiRes's time
as a starting filename, and File::Temp.
AUTHOR
Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Net-a-porter.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.