# Module comm_logger

- Description
- Data Types
- Function Index
- Function Details

Service for loggins messages.

Copyright © 2008-2014 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_server`.

Authors: Thorsten Schuett (`schuett@zib.de`).

## Description

Service for loggins messages.

## Data Types

### erlang_timestamp()

    erlang_timestamp() =
        {MegaSecs :: non_neg_integer(),
         Secs :: 0..999999,
         MicroSecs :: 0..999999}

API

### stat_tree()

    stat_tree() =
        gb_trees:tree(Tag :: atom(),
                      {Size :: non_neg_integer(),
                       Count :: pos_integer()})

## Function Index

code_change/3 |
dump/0 |
handle_call/3 |
handle_cast/2 |
handle_info/2 |
init/1 |
log/3 |
start_link/0 |
terminate/2 |

## Function Details

### start_link/0

    start_link() -> {ok, pid()} | ignore | {error, any()}

### log/3

    log(SendRcv :: send | rcv,
        Tag :: term(),
        Size :: non_neg_integer()) ->
           ok

### dump/0

    dump() ->
            {Received :: stat_tree(),
             Sent :: stat_tree(),
             erlang_timestamp()}

### init/1

    init(X1 :: list()) ->
            {ok,
             #state{start = undefined | erlang_timestamp(),
                    received = undefined | stat_tree(),
                    sent = undefined | stat_tree()}}

### handle_call/3

    handle_call(Request :: {dump},
                From :: any(),
                State ::
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}) ->
                   {reply,
                    {Received :: stat_tree(),
                     Sent :: stat_tree(),
                     erlang_timestamp()},
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}}

### handle_cast/2

    handle_cast(Msg :: {log, send | rcv, atom(), non_neg_integer()},
                State ::
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}) ->
                   {noreply,
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}}

### handle_info/2

    handle_info(Info :: any(),
                State ::
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}) ->
                   {noreply,
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}}

### terminate/2

    terminate(Reason :: any(),
              State ::
                  #state{start = undefined | erlang_timestamp(),
                         received = undefined | stat_tree(),
                         sent = undefined | stat_tree()}) ->
                 ok

### code_change/3

    code_change(OldVsn :: any(),
                State ::
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()},
                Extra :: any()) ->
                   {ok,
                    #state{start = undefined | erlang_timestamp(),
                           received = undefined | stat_tree(),
                           sent = undefined | stat_tree()}}

Generated by EDoc, Feb 29 2016, 16:12:14.