%%
%% %CopyrightBegin%
%% 
  Copyright Ericsson AB 2002 - 2016 . All Rights Reserved .
%% 
  Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%%     -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an " AS IS " BASIS ,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%% 
%% %CopyrightEnd%
%%
-module(snmpa_error_io).

-behaviour(snmpa_error_report).


%%%-----------------------------------------------------------------
%%% Implements different error mechanisms.
%%%-----------------------------------------------------------------
-export([user_err/2, config_err/2]).


%%-----------------------------------------------------------------
%% This function is called when there is an error in a user
%% supplied item, e.g. instrumentation function.
%%-----------------------------------------------------------------
user_err(F, A) -> 
    error_msg("User error", F, A).


%%-----------------------------------------------------------------
%% This function is called when there is a configuration error,
%% either at startup (in a conf-file) or at run-time (e.g. when 
%% information in the configuration tables are inconsistent.)
%%-----------------------------------------------------------------
config_err(F, A) ->
    error_msg("Configuration error", F, A).


error_msg(P, F, A) ->
    io:format("*** SNMP ~s *** ~n" ++ F ++ "~n", [P|A]).



 %CopyrightBegin%
 
 
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     -2.0

 Unless required by applicable law or agreed to in writing, software
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 
 %CopyrightEnd%

-----------------------------------------------------------------
 Implements different error mechanisms.
-----------------------------------------------------------------
-----------------------------------------------------------------
 This function is called when there is an error in a user
 supplied item, e.g. instrumentation function.
-----------------------------------------------------------------
-----------------------------------------------------------------
 This function is called when there is a configuration error,
 either at startup (in a conf-file) or at run-time (e.g. when 
 information in the configuration tables are inconsistent.)
-----------------------------------------------------------------
  Copyright Ericsson AB 2002 - 2016 . All Rights Reserved .
  Licensed under the Apache License , Version 2.0 ( the " License " ) ;
  distributed under the License is distributed on an " AS IS " BASIS ,
-module(snmpa_error_io).

-behaviour(snmpa_error_report).


-export([user_err/2, config_err/2]).


user_err(F, A) -> 
    error_msg("User error", F, A).


config_err(F, A) ->
    error_msg("Configuration error", F, A).


error_msg(P, F, A) ->
    io:format("*** SNMP ~s *** ~n" ++ F ++ "~n", [P|A]).

