The ember data models have a toJSON method that extracts the relevant data:
console.log(model.toJSON());
This method uses the JSONSerializer to create the JSON representation.
If you want to log the data in a more app-specific way, you can use serialize:
model.serialize();
which uses the serialization strategy you can define in the store's adapter to create a JSON representation of the model.
All objects in an Ember app, including Ember Data models, inherit from Ember.CoreObject, which has a toString method that prints this representation:
<app-name@ember-type:object-name:id>
Explanation:
app-name
is the name of your applicationember-type
is the ember type of the object you are logging (can be controller, route etc.)object-name
is the name of the object you are logging (name of your model, or controller, or route etc.)You can overwrite this value using the method toStringExtension
in your particular model.
For comparison example, here's how logging an application controller could look:
<my-awesome-app@controller:application::ember324>