Hi Ben.

2016-04-20 21:05 GMT+02:00 Ben Coman <b...@openinworld.com>:

> Sorry for not having a better reviewed understanding of both
> frameworks, but I have some thoughts from perspective of one user...
>

So if you look at code you will see that what you mention below is not
truth for current design (names)


>
>
> > There are few things which I not like in SystemLogger (which not means
> that
> > everything is good with Beacon):
> >
> > name Log to represent records of the underlying "physical log".
> >
> > IMHO Log means exactly end logging backend like text file, syslog or
> > external database. Log is the place where we can explore (read) what was
> > happen.
>
> You are considering Log as a noun, but it can also be used as a verb.
> defn "13. to enter in a log; keep a record of; e.g. to log a day's
> events." [1]
>

I only mentioned it as noun. But to log objects I want log it in verb
meaning


anyObject log



> Stef said: "Remember that you want to have them short especially for
> the main one. This is why in SystemLogger
> we have Log instead of what it is LogObject"
> from which I understood that Log was the client interface, to be used
> like Transcript.  I think this is a good idea.  It would create the
> LogEntry
>

And in SystemLogger Log is client interface and in same time it is log
entry.
But why we prefer to use Log? What wrong with direct object message? I
would write:

object log

'some string message' log

'some debug string message' logForDebug.
'some error string message' logAsError



> [1] http://www.dictionary.com/browse/log
>
> > And now these backends are represented by subclasses of Logger:
> > StdoutStreamLogger, SysLogSender. I would call them StdoutLog, SysLog.
> > But with such change we need to call log entry differently. It can be
> > LogRecord or LogEntry. I not understand what was the problem with such
> > names? (there was some explanation why Log was chosen for this)
>
> Considering a "log" being the final resting point of the logged
> objects, that is the external disk text file or database, then within
> Pharo we don't have logs, only processes that write to the external
> logs, so Logger seems appropriate.  This is except for an in memory
> log, which for backend might need both MemoryLogger and
> MemoryObjectLog.
>

I can't agree here. Does not we model real world objects with objects and
not functions?
If I want to read records from SysLog should I create SysLogReader? So in
one place I will use SysLogLogger and in another place I will use
SysLogReader. I not like such design.
If I want to work with SysLog I would represent it with SysLog class. It
can support both operations: appending new entries and querying existing
entries. Of course internally it can use SysLogReader and SysLogWriter. But
as user I want to start with SysLog and internal details should be hidden
from me.

If you remember before FileSystem we had some kind of file streams and no
real object to represent file. And now we have FileReference and we can ask
it for #readStream or #writeStream. It's much better.


>
> Log would create and send theLogEntry to SystemLogger
> which forwards theLogEntry to other registered XXXLogger backend.
>

For me it is bad when same name is used for objects with different roles.
If we call backends with suffix "Logger" then we should not use it for
anything which is not backend.


>
> > name SystemLogger for collection based log.
> >
> > SystemLogger makes me think that it is singleton which is used by system
> and
> > I should not use it for my own application.
>
> I guess your application would make use SystemLogger via Log at the
> front end, and registering backends with SystemLogger.
>

Now SystemLogger is MemoryObjectLog. It is not dispatcher for other loggers.

Anyway I'm sure using name "system" for general purpose framework is bad
idea.
If I will need non global logger how I will reuse SystemLogger? It will
feel like hack because I will take some global "System" object to use it in
my local application.


>
> > I would call it like ObjectLog or NativeLog (following my first sentence
> > about Log).
>
> NativeLog doesn't seems right.  ObjectLog might be suitable for an
> in-memory backend, like above I mention MemoryObjectLog.
>
> > Also it is intercepted with SysLog name and I guess that's why it was
> called
> > SysLogSender and not SysLogLogger.
> >
> > name LogDispatcher.
>
> LogDispatcher is okay, but I'm not sure of convention to be associate
> the "doer" with the "target" rather than the "item", where
> doer=Dispatcher; item=LogEntry; target=final-backend-log;   A little
> it sounds like its dispatching a whole log rather than one log entry.
> Maybe should be LogEntryDispatcher(??) or... SystemLogger as the
> marshalling point to forward to other XXXLoggers.
>
> >
> > Here same problem as Log. What means physical logs dispatching? I know
> it is
> > introduced around Log as log entry. But it is not intuitive for me (same
> as
> > Log).
>
> I don't think Log should be a log entry.  It should be the user
> interface that creates and sends LogEntries via some XXXLogger.
>
> > In context of Log as real log (FileLog, SysLog) I would call this
> dispatcher
> > as Logger with same responsibility to register new events in all
> registered
> > logs.
> >
> >
> > announcements LogAdded and LogRemoved in the core.
> >
> > Why any Logger should announce every log entry?
> > I think we not need special LoggerUI app. We can just inspect
> SystemLogger
> > instance to look at all recorded objects. And in perspective of my
> > suggestions it will mean that we just explore particular ObjectLog. And
> we
> > can extend GTInspector for this.
>
> GTInspector would need good live updating, filtering, clearing,
> scrolling to keep cursor position as new entries arrive.
>

It is already here I guess. If not then it should be improved and I think
it is already in plan.
What you mention is needed to inspect any collections.

Reply via email to