...

> The point is: I don't like the close relationship between logging and
> serialization. If the serialization communicated over a clear API with
> logging class than it is no problem.
If you don't like it, don't use it. Just ignore it and initialize 
logging from a file. It is a feature, you can use but don't need to. 
There is actually no close relationship between logging and serialization.

>   
> LoggingInfo logConfigInfo = SerializationFactory.getLogingConf( "logging.conf"
> );
What does it mean? You read some logging from a configuration file? Why 
not just use:
log_init("logging.conf");

> logConfigInfo.setLevel( LoggingInfo::DEBUG );
> logConfigInfo.swichOn( "tntdb" );
> logConfigInfo.swichOff( "component_A" );
> logger = LogerFactrory( logConfigInfo );
If you want to use switchOn and switchOff to enable or disable logging 
for a specific category you did not quite understood, what it mean. A 
category is not just on and off but have a logging level.
> Now it is irrelevant where the data comes:
>
> LoggingInfo logConfigInfo = PersistentDatasBaseAPI:getLogingConf( "psql",
> "configs", "debugging_profile" );
> logger = LogerFactrory( logConfigInfo );
You want to read the configuration from the database? How it is stored? 
You have to define some schema for that. It is quite easy to convert the 
schema to a proper SerializationInfo (sorry to mention that).
> or
>
> LoggingInfo logConfigInfo = PresidentDatasBaseAPI:getLogingConf( 
> "stage_profile"
> );
> logger = LogerFactrory( logConfigInfo );
>
> or
>
> LoggingInfo logConfigInfo = CommandLineAPI:getLogingConf( );
> logger = LogerFactrory( logConfigInfo );
As I said it is very difficult to specify all the options from the 
command line. The command line will get very complicated. Not to say 
unusable.
>
> or
>
> LoggingInfo logConfigInfo = TcpIPAPI:getLogingConf(
> "sftp://myFunnyIdea.de/proof_of_concept.conf"; );
> logger = LogerFactrory( logConfigInfo );
If you read the configuration from some remote site, you have to 
specify, in which format the remote site sends the data. Maybe you want 
to use json format for that? Then use the JsonDeserializer to convert it 
into a SerializationInfo and configure logging with that. Or you prefer 
xml? Then use the XmlDeserializer. Or a compact binary format to 
minimize size? Use the binary deserializer.
>
> or
>
> LoggingInfo logConfigInfo = VersionControllAPI:getLogingConf(
> "git://myFunnyIdea.de/", "log.config", "test_branch" );
> logger = LogerFactrory( logConfigInfo );
>
> or whatever.
The same is valid for git. You read a file from git. You have to convert 
the file somehow to a configuration. You have to decide, which format it 
has. Take the proper deserializer and you get it.

It may help to make the deserialization operator of the logging 
configuration public somehow, so that you do not have to use 
SerializationInfo. But you will need to parse the configuration somehow 
no matter where the configuration comes from. And that's what 
deserialization is for.


Tommi

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to