Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Import constants?

by DreamT (Pilgrim)
on Aug 05, 2010 at 07:25 UTC ( [id://853039]=perlquestion: print w/replies, xml ) Need Help??

DreamT has asked for the wisdom of the Perl Monks concerning the following question:

Hi!
So, I've discovered a new "concept" (at least in my "Perl-world") Importing of constants.
I'm using DBIx::Log4perl and want to use the constant DBIX_L4P_LOG_OUTPUT

The module i want to use is available at http://search.cpan.org/dist/DBIx-Log4perl/lib/DBIx/Log4perl.pm#CONSTANTS

The description says:
GLOBAL VARIABLES ^ DBIx::Log4perl::LogMask This variable controls the amount of logging logged to the Log::Log4pe +rl handle. There are a number of constants defined which may be ORed +together to obtain the logging level you require: CONSTANTS ^ The following constants may be imported via the :masks group use DBIx::Log4perl qw(:masks); ... DBIX_L4P_LOG_OUTPUT Log at Log4perl debug level the result-sets generated by select* o +r fetch* methods. Be careful, this could produce a lot of output if y +ou produce large result-sets.


Any ideas?

Replies are listed 'Best First'.
Re: Import constants?
by BrowserUk (Patriarch) on Aug 05, 2010 at 08:10 UTC
    Any ideas?

    Yes. You've C&P'd the exact information required to achieve your stated goal.

    You haven't a) asked a question; b) cited an error; c) or said which bit you don't understand.

    Attempt one of a, b or c.

      Ok, then I will choose c :-) I don't understand how and in which order to put the different pieces.

        Try something like

        use DBIx::Log4perl qw(:masks); $DBIx::Log4perl::LogMask = DBIX_L4P_LOG_OUTPUT | DBIX_L4P_LOG_INPUT;

        The values of the constants represent individual bits being set, i.e.

        (binary) DBIX_L4P_LOG_INPUT 1 00000001 DBIX_L4P_LOG_OUTPUT 2 00000010

        Each bit activates a certain functionality. You can combine them using bitwise or (|), e.g.

        00000001 00000010 -------- 00000011

        The resulting value has all bits set which were set in any of the or'ed input values.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://853039]
Approved by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found