@@ -13,6 +13,7 @@ limitations under the License.
13
13
14
14
import { Temporal } from "@js-temporal/polyfill" ;
15
15
import DaprClient from "../../implementation/Client/DaprClient" ;
16
+ import { Logger } from "../../logger/Logger" ;
16
17
import ActorId from "../ActorId" ;
17
18
import ActorClient from "../client/ActorClient/ActorClient" ;
18
19
import ActorStateManager from "./ActorStateManager" ;
@@ -42,6 +43,10 @@ export default abstract class AbstractActor {
42
43
private readonly actorClient : ActorClient ;
43
44
private readonly daprStateProvider : StateProvider ;
44
45
private readonly actorType : any ; // set at constructor level
46
+ private readonly logger : Logger ;
47
+
48
+ private readonly LOG_COMPONENT : string = "Actors" ;
49
+ private readonly LOG_AREA : string = "AbstractActor" ;
45
50
46
51
/**
47
52
* Instantiates a new Actor
@@ -52,7 +57,7 @@ export default abstract class AbstractActor {
52
57
constructor ( daprClient : DaprClient , id : ActorId ) {
53
58
this . daprClient = daprClient ;
54
59
this . actorClient = new ActorClient ( daprClient . getDaprHost ( ) , daprClient . getDaprPort ( ) , daprClient . getCommunicationProtocol ( ) , daprClient . getOptions ( ) ) ;
55
-
60
+ this . logger = new Logger ( daprClient . getOptions ( ) . loggerOptions )
56
61
this . id = id ;
57
62
58
63
this . stateManager = new ActorStateManager ( this ) ;
@@ -201,7 +206,7 @@ export default abstract class AbstractActor {
201
206
}
202
207
203
208
async receiveReminder ( _data : string ) : Promise < void > {
204
- console . warn ( JSON . stringify ( {
209
+ this . logger . warn ( this . LOG_COMPONENT , this . LOG_AREA , JSON . stringify ( {
205
210
error : "ACTOR_METHOD_NOT_IMPLEMENTED" ,
206
211
errorMsg : `A reminder was created for the actor with id: ${ this . id } but the method 'receiveReminder' was not implemented` ,
207
212
} ) ) ;
0 commit comments