Skip to content

Ftylog::setVerboseMode() reset the Ftylog instance (logger/appenders) #34

@FrancoisRegisDegott-eaton

Description

code sample:
bool verbose; //variant
ftylog_setInstance("my_agent_name", FTY_COMMON_LOGGING_DEFAULT_CFG);
if (verbose) ftylog_setVerboseMode(ftylog_getInstance());
log_info("my info");

verbose = false, output is
2020-04-26 11:25:38 my_agent_name [INFO ] src/example.c:28 my info
verbose = true, output is
my_agent_name [140660466603840] -INFO- main (src/example.c:28) my info

other example, using bmsg command (fty-proto/blob/master/src/bmsg.c#L361)
bmsg monitor _EULA playing with -v option
see the different console logs

~$ bmsg monitor _EULA
bmsg - Command line tool to work with fty proto messages
2020-04-26 11:50:19 bmsg [TRACE] src/bmsg.c:387 command=monitor
2020-04-26 11:50:19 bmsg [TRACE] src/bmsg.c:396 address: bmsg.83904275
I: 20-04-26 11:50:19 My address is 'bmsg.83904275'
2020-04-26 11:50:19 bmsg [TRACE] src/bmsg.c:429 set consumer (_EULA, .)
^C
~$ bmsg -v monitor _EULA
bmsg - Command line tool to work with fty proto messages
bmsg [139726711945024] -TRACE- main (src/bmsg.c:387) command=monitor
bmsg [139726711945024] -TRACE- main (src/bmsg.c:396) address: bmsg.83912911
I: 20-04-26 11:50:28 My address is 'bmsg.83912911'
bmsg [139726711945024] -TRACE- main (src/bmsg.c:429) set consumer (_EULA, .
)
^C

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions